Mysql – Reset MySQL root password

In this article we will see how to reset MySQL root password (when password is lost for example).

You need to be root on the shell. Then we need to restart mysql with the skip-grand-table mode :

Now you can login as root mysql without password and change it, for this we login to the mysql database as root

Then we change the password

Now restart the mysql service

Mysql root password is now changed !