Would you like to learn how to recover the MariaDB admin password? In this tutorial, we are going to show you how to use the MariaDB password recovery procedure to change the password of the ROOT user using the command-line of a computer running Ubuntu Linux.

• Ubuntu 20
• Ubuntu 19
• Ubuntu 18
• MariaDB 10.3

Tutorial MariaDB - Password Recovery

Stop the MariaDB service.

Copy to Clipboard

Create the required directory and set the proper permission.

Copy to Clipboard

Restart the MariaDB service using the following command.

Copy to Clipboard

Here is the command output:

Copy to Clipboard

Access the MariaDB command-line.

Copy to Clipboard

Set a new password to the MariaDB root user.

Copy to Clipboard

In our example, we set the password 123qwe.

Stop the MariaDB service using the following command.

Copy to Clipboard

You will need to enter the new MariaDB root password to stop the service.

Start the MariaDB service.

Copy to Clipboard

Try to access the MariaDB service using the new root password.

Copy to Clipboard

Congratulations! You successfully recovered the password of the MariaDB root user.