I use the MySQL5.5, other versions have not been tested.
1. Go to the Command Line window and stop the MySQL service
- net stop MySQL
2. Enter Mysqld--skip-grant-tables (the current CMD window may not respond, ignore)
3. Reopen a CMD window and perform the following actions:
- Mysql-uroot
- Update Mysql.user set Password=password (' New password ') where user= ' root ';
4. Open Task Manager to end the Mysql.exe,mysqld.exe process
5. Restart the MySQL service (net start MSYQL) (if you are prompted that MySQL boot is unsuccessful, the reset password will mostly fail, you can restart Windows and repeat the above).
--------------------------------------------------------------------------------------------------------------- -
In summary, resetting the MySQL password is successful and can be tested in the following ways:
Reset MySQL password under windows (the first reason is because access denied for user ' root ' @ ' localhost ' is not able to log on to ' root ' @ ' localhost ')