Tuesday, January 24, 2012

How to reset MySQL password

Stop the mysql demon process using this command :
sudo /etc/init.d/mysql stop

Start the mysqld demon process using following command
sudo /usr/sbin/mysqld --skip-grant-tables --skip-networking &

mysql -u root

The following command will allow to change the password
FLUSH PRIVILEGES;

Update the password
SET PASSWORD FOR root@'localhost' = PASSWORD('password');

More details available here

No comments:

Post a Comment

Constructor Chaining