This is the procedure for resetting the root password. Use it if you forget the root user password and cannot enter it as an administrator.
You can log in without user authentication by restarting the MariaDB server with the following description in the MySQL configuration file.
Reference: Restart MariaDB on Ubuntu
In this state, follow the procedure for setting the root password.
After resetting the root password, be sure to remove the "skip-grant-tables" in the MariaDB config file and reboot.