How to recover the mysql root password ?


First stop the mysql service and Start to MySQL server without  password using this command 
# mysqld_safe --skip-grant-tables 
& Connect to mysql server using mysql client:
# mysql -u root and use below commands
mysql> use mysql;
mysql> update user set password=PASSWORD("NEW-ROOT-PASSWORD") where User='root';
mysql> flush privileges;
mysql> quit

No comments:

Post a Comment