1. Stop the MYSQL service. In CMD, open the DOS window, enter netstopmysql2, and in the CMD command line window, enter the MYSQL installation directory, for example, E: ProgramFilesMySQLMySQLServer5.0bin. Run the following command: Enter e: Press enter and enter cdE: programFilesMySQLMySQLServer5.0bin pay attention to double quotation marks, so that
1. stop the MYSQL service. In CMD, open the DOS window, enter net stop mysql 2, and in the CMD command line window, enter the MYSQL installation directory, such as E: \ Program Files \ MySQL Server 5.0 \ bin demonstration command: Enter e: Press enter, enter cd E: \ Program Files \ MySQL Server 5.0 \ bin. Note that double quotation marks must also be entered, in this way
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, for example, E: \ Program Files \ MySQL Server 5.0 \ bin.
Demo command:
Enter e: enter,
Enter cd "E: \ Program Files \ MySQL Server 5.0 \ bin"
Note that double quotation marks must also be entered to enter the Mysql installation directory.
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
(Mysql 5.5 is:
Mysqld -- 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!