Recover the MySQL Root Password Easily

To recover your MySQL database server password follow these five easy steps..
Step 1:
Stop the MySQL service..

service mysql stop


service mysqld stop

Step 2:
Start the MySQL server without any passwords..

mysqld_safe --skip-grant-tables &

Step 3:
Connect to mysql server using mysql client..

mysql -u root

Step 4:
Setup new MySQL root user password by running the commands below in order..

use mysql;
update user set password=PASSWORD("NEW-ROOT-PASSWORD") where User='root';
flush privileges;

Step 5:
Stop MySQL Server..

service mysql stop


service mysqld stop

Step 6:
Start MySQL server and test it

service mysql start


service mysqld start


Related Articles

One Comment

Leave a Reply

Your email address will not be published. Required fields are marked *


This site uses Akismet to reduce spam. Learn how your comment data is processed.

Back to top button