Tuesday, December 17, 2013

How to reset mysql root password

Login to database with user root,
then select database mysql and update password field with no password.
$ mysql -u root -p
mysql> use mysql;
mysql> update user set password = '' where user = 'root';

or, you may delete the password only for localhost:
mysql> update user set password = '' where user = 'root' and host = 'localhost';

No comments:

Post a Comment