MySQL Change Passwords

MySQL Change Passwords

To set the root password for the first time:
$ mysqladmin -u root password NEWPASS
To update the root password:
$ mysqladmin -u root password OLDPASS NEWPASS
If you want to update root password using mysql command, login to mysql, then:
mysql> update user set password=PASSWORD("NEWPASSWORD") where User='username';
now you will need to update the privileges:
mysql> flush privileges;
Change password for other users:
$ mysqladmin -u username -p OLDPASS NEWPASS
Enjoy MySQL.

Leave a Reply

Your email address will not be published. Required fields are marked *

My new Snowflake Blog is now live. I will not be updating this blog anymore but will continue with new contents in the Snowflake world!