Thursday, May 9, 2013

Recover MYSQL Database Password




                                 Recover MYSQL database password


Recover MySQL database password with following easy steps.

Stop the MySQL server process.
#service mysqld stop

Start the MySQL (mysqld) server/daemon process with the --skip-grant-tables option so that it will not prompt for password.
#mysqld_safe --skip-grant-tables &




Now that you are in MySQL, run these:
#mysql -u root


Update Mysql root user password
UPDATE mysql.user SET Password=PASSWORD('yourpass') WHERE User='root'; 

FLUSH PRIVILEGES;

Exit

Login again using New Password.

#mysql -u root -p"newpassword"

Log back in with new password