1. Find the location where MySQL is installed
Input cmd: Go to MySQL bin installation directory
such as: D:\Program files\mysql\mysql Server 5.5\bin>mysqld--skip-grant-tables
Execute the command as above: This cmd window is not moving yet.
2. Reopen a new command form
Enter CMD to go to the installation directory bin file to execute the MySQL command
Example: D:\Program files\mysql\mysql Server 5.5\bin>mysql
Enter the following command: To change the password:
mysql> use MySQL
Database changed
mysql> Update user set Password=password ("123") where user= "root";
Query OK, 1 row affected (0.05 sec)
Rows matched:1 changed:1 warnings:0
Refresh permissions:
mysql> flush Privileges;
Query OK, 0 rows affected (0.16 sec)
exit command form
Mysql> quit;
3. Re-enter MySQL
D:\Program files\mysql\mysql Server 5.5\bin>mysql-u root-p
Enter Password: * * *
Welcome to the MySQL Monitor. Commands End With; or \g.
Your MySQL Connection ID is 2
Server version:5.5.28 MySQL Community Server (GPL)
4. Remark:
If there is an error, please end MySQL in the service, or net stop MYSQL5
Mysql Recover Password