1, first to stop the MySQL service. Open cmd, type command
net stop MySQL
The default MySQL service name is MySQL, if you have modified the service name, please modify the command in your own control.
2, in the cmd into the MySQL bin directory, for example, my is C:\mysql\bin, type command
Mysqld-nt--skip-grant-tables
This command is used to skip the MySQL permission check table, and if the command succeeds, the CMD window will be found to be stuck.
3. Reopen a CMD window and enter the MySQL bin directory again, type the command
Mysql-u Root
You will be logged in as root and you can see that the command prompt changes to mysql>.
4, change the root password. Type the command in turn
Use MySQL
Update user set Password=password ("New password") where user= "root";
Flush privileges;
Exit
The function is to enter MySQL library, change the root password, update the MySQL permission table, exit.
5. Use Ctrl-alt-del to bring up the Task Manager and terminate the Mysqld-nt.exe process.
6. Use the command under CMD
net start MySQL
Restart the MySQL service.
Article Slyar Article source: Slyar Home (www.slyar.com).
Reset the root user password for MySQL (Window)