Windows:
1. log on to the operating system as a system administrator.
2. In management tools and service management, find the MySQL service and stop the MySQL service.
3. enter cmd in start-run to enter the DOS window, and then enter the MySQL installation directory. For example, my installation directory is E: \ Program Files \ mysql \ MySQL Server 5.0 \ bin
Enter E: enter,
Enter cd "E: \ Program Files \ mysql \ MySQL Server 5.0 \ bin"
Note that double quotation marks must also be entered to enter the MySQL installation directory.
4. Skip the permission check and start MySQL,
Enter
Mysqld-NT -- skip-grant-tables
Enter
5. Then, Enter cmd again at the start of the operation and open a DOS window again to enter the MySQL installation directory, as mentioned earlier.
Enter
Mysqladmin-u root flush-Privileges password "888888"
Enter
888888 indicates the new password to be entered.
Enter
Mysqladmin-u root-P Shutdown
You will be prompted to enter a new password and repeat the password entered in the first command.
6. Stop MySQL server and start MySql in Normal Mode
7. You can use a new password to link to MySQL.