Article content mainly reference http://www.kuqin.com/database/20080306/4249.html
1. Stop mysql. Open the DOS window in cmd and enter net stop MySQL.
2. In the CMD command line window, enter the MySQL installation directory, such as C:/program files/MySQL Server 5.0/bin.
3. Enter the MySQL security mode, that is, when MySQL is up, it can enter the database without entering the password.
Command: mysqld-NT -- skip-grant-tables
4. Open a new cmd command line window, enter mysql-uroot-P, and log on to MySQL using a blank password (Press enter without entering the password)
5. Enter the following command to modify the password of the root user (Note: There is a "point" in the middle of MySQL. User ")
Mysql> Update mysql. User SET Password = PASSWORD ('new password') where user = 'root ';
6. Refresh the permission table
Mysql> flush privileges;
7. Exit
Mysql> quit
So MySQL super Administrator account root has been reset, then in the task manager to end the mysql-nt.exe this process, restart MySQL! (You can also restart the server)
After MySQL is restarted, you can log on to MySQL with the newly set root password!