Steps to be made for the newly initialized database
1 password was set for root
2 Deleting the Default user
3 Delete the default test library
Ways to change passwords
1 set the password for the administrator (start without password)
Mysqladmin-uroot password ' 12qwaszx ';
2 Change Password
Method One: Mysqladmin management tools (recommended)
Mysqladmin-uroot-p ' 12qwaszx ' password ' c110123 ';
Note There are spaces (between password and the new password)
Method Two: Modify the Content field of the Mysql.user
Update Mysql.user set Password=password (' 12qwaszx ') where user= ' root ' and host= ' 127.0.0.1 ';
Frequently used scenarios: After the password is lost, the password is changed after starting the data with the--skip-grant-tables parameter
Tips:
Conditions must be specified, SQL must be skilled and cautious
You must specify the password function to encrypt the change password.
Method Three:,
Set Password=password (' 123456 ');
Change the user password that is currently logged in
This method is not suitable for password loss--skip-grant-tables after password change
Must change password after must execute flush privileges;
This article is from the "Tridewah operation and maintenance work Road" blog, please be sure to keep this source http://cuidehua.blog.51cto.com/5449828/1762142
MySQL Change password