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 *