Would you like to learn how to recover the MySQL admin password? In this tutorial, we are going to show you how to use the MySQL password recovery procedure to change the password of the root user using the command-line of a computer running Ubuntu Linux.
• Ubuntu 18.04
• Ubuntu 19.04
• MySQL 8.0.18
Equipment list
The following section presents the list of equipment used to create this tutorial.
As an Amazon Associate, I earn from qualifying purchases.
Related tutorial – MySQL
On this page, we offer quick access to a list of tutorials related to MySQL.
Tutorial MySQL – Password Recovery
Stop the MySQL service.
Create the required directory and set the proper permission.
Restart the MySQL service using the following command.
Here is the command output:
Access the MySQL command-line.
Set a new password to the MySQL root user.
In our example, we set the password kamisama123 to the MySQL root user
Stop the MySQL service using toe following command.
You will need to enter the new MySQL root password to stop the service.
Start the MySQL service.
Try to access the MySQL service using the new root password.
Congratulations! You successfully recovered the password of the MySQL root user.