How to change root mysql password

1. Login to mysql, and type the following command:
$ mysql -u root -p

2. Switch to the mysql database:

mysql> use mysql;

3. Change password for user root, enter:

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

4. Reset the privileges:

mysql> flush privileges;

No comments:

Post a Comment