20080718

Set mysql root password

To set password for the first time:
$ mysqladmin -u root password NEWPASSWORD


To change password:
$ mysqladmin -u root -p OLDPASSWORD NEWPASSWORD


To login with password:
$ mysql -u root -p PASSWORD


To change password mysql sql command:
mysql> use mysql;
mysql> update user set password=OLDPASSWORD("NEWPASSWORD") where User='USERNAME';
mysql> flush privileges;
mysql> quit

No comments:

Post a Comment