MySQL The root user forgot password recovery method:
1. Close all running mysqld processes first:
Killall mysqld
2. Start MySQL with the Skip authorization table parameter:
Mysqld_safe--skip-grant-tables--user=mysql &
3, for [email protected] To set a new password:
Mysql-u root-p//log in to the database with a blank password
Use MySQL; Select the name of the library to manipulate
Update user set Password=password (' NewPassword ') where user= ' root '; Change the root user's password
4, the normal restart after MySQL can be used to login with the new password or flush privileges;
Note: 1) If you are familiar with the SQL statement, the update does not have to explain the first user is a table
The first name and the second user are the fields in the table. The first password is the field in the table, and the second password () is
The function used for encryption. New_pass is the password to change.
2) flush privileges can not be added. Direct restart
Linux---mysql password recovery method