1. The user changes the password;
Method One: Mysqladmin-u user-p password password ' new password '
Mysqladmin-uroot-pdefault password ' zhouli.cn '
Method Two: Set Password=password ("New_password");
Mysql> set Password=password ("Default");
Method Three: Update Mysql.user set Password=password (' New password ') where user= ' user ' and host= ' address ';
Update Mysql.user Set Password=password ("Default") where user= ' root ' and host= ' localhost ';
Flush privileges;
2.root user modifies other user's password
Method One: Set password for user @ ' address ' =password (' new password ');
mysql> Set password for [email protected] ' localhost ' =password ("Sql_sql");
Method Two: Mysqladmin-u user-p password password ' new password '
Mysqladmin-uuser1-pzhouzhou password ' Nihao '
3. Forgot root password how to solve
1) When you turn on the MySQL service, add the--skip-grant-tables parameter
Mysqld_safe--skip-grant-tables
Mysql-uroot Direct return, then use Update to change the root password can be
Update Mysql.user Set Password=password ("Default") where user= ' root ' and host= ' localhost ';
MySQL Password change