Lost MySQL ROOT Password ??? Don’t Worry. Here is the trick to Reset it !!!
Worrying of LOST the ROOT Password. Don’t have to worry. Here is the trick, to get it solved and recover the reset the password, so that you can login to MySQL again.
Firstly, stop theMySQL Server as below:
# /etc/init.d/mysql stop
Then start the MySQLD daemon with -skip-grant-tables as shown below:
# mysqld_safe --skip-grant-tables &
Now Connect to MySQL server as shown below with the root user:
# mysql -u root
Now you can reset the password with your choice as shown below:
mysql> use mysql;
mysql> update user set password=PASSWORD("NEW-ROOT-PASSWORD") where User='root';
mysql> flush privileges;
mysql> quit
Now exit from the MySQL prompt and Stop the MySQL server as shown below:
# /etc/init.d/mysql stop
Start the MySQL Server:
# /etc/init.d/mysql start
Connect to the MySQL database server as shown the below with root user and the password you set.
# mysql -u root -p
Popularity: 51% [?]
No Comments »
Filed under: Mysql Tips & Tricks









