Changing MySQL root password using the MySQL console

MySQL stores username and passwords in user table inside MySQL database. You can directly update password using the following method:

Use mysql database (type command at mysql> prompt):

mysql> use mysql;

Change password for user root:

mysql> update user set password=PASSWORD("NEWPASSWORD") where User='root';

Don’t forget to flush the privileges cache:

mysql> flush privileges;
mysql> quit

Voila!

Popularity: 1% [?]

No related posts

About Jean-Michel Paris

Posts Author & Blog Administator