1. Open the MySQL profile My.ini, add the skip-grant-tables to the end of the file, or add it to the bottom of [mysqld] (directly added to the My.ini file at the end of the pro test can, but in [mysqld] I have not tried, Now this file as long as save, do not shut down, will also be used! )。 2. Then restart the MySQL service in Windows environment: net stop MySQL net start mysql if there is not a valid command, note the configuration of the environment variable 3. Set the root password to open an MS-DOS interface, output mysql– on the command Uroot–p then asked to enter the password, you can now directly enter! (OK, is it possible to log in now?) Now we execute the following statement to update the root password to 123456:update user set Password=password ("123456") where user= ' root '; (note case, Double and single quotes and the last semicolon) 4. Exit MySQLquit5. Restore the configuration file and restart the "Skip-grant-tables" button above to delete it, restart the service if found to enter MySQL5.5 command line again When the client does not need a password at all, execute the following statement 6. Log in to MySQL, using the MySQL database, the specific command is: >mysql;>use mysql;7, change the user table root account password is "123123", the specific command is: >update user Set Password = password (' 123123 '); >flush privileges; (flush privileges is refresh current user rights) 8, exit MySQL, Turn off the MySQL service; 9. Normal start of MySQL service.
Solution for forgetting MySQL maximum user rights password under Windows