In general, there are several ways to modify user passwords in MySQL:
1. Modify your password to be available:
Set Password=password (' 123456 ');
2. Modify other user's password to be available:
Set password for ' username ' @ ' host ' =password (' 123456 ');
3. By modifying the password field in the user table in the MySQL library, you can:
Update Mysql.user set Password=password (' 123456 ') where user= ' username ' and host= ' 192.168.1.172 ';
4. Use the mysqladmin command:
mysqladmin-uusername-p1234 password "123456" (where 1234 is the old password and 123456 is the new password)
The above several command methods are in the user login and have the appropriate permissions to modify, such as the root user, if the root user's password has also forgotten how to do, you can modify the following ways:
1. Close the database: service MySQL stop;2. Use Mysqld_safe--skip-grant-tables & start Database3. Use a blank password to enter the database: After the MySQL command, enter directly. 4. Use the UPDATE statement to modify the root password. 5. Close the database and restart the data service in normal mode MySQL stop;service mysql start;
MySQL forgot root user password modification method