This article mainly describes how to solve the problem of forgetting the MySQL root password on the Windows server, we all know that in practice, if you forget your MySQL root Password, It is a headache. The following article will solve this problem.
Subbranch cmd to MySQL bin directory
- bin>MySQLd-nt.exe --skip-grant-tables &
Open new command window
- Bin> MySQL-u root
- MySQL> update MySQL. user set password = PASSWORD ('new password') where User = 'root ';
- MySQL> flush privileges;
- MySQL> quit
1. Specify the directory in the command to the bin directory under MySQL, enter the command: MySQLd-nt.exe -- skip-grant-tables &
This operation aims to skip the permission Checklist
2. Enter the command: MySQL-u root in the command line.
The purpose of this operation is to log on with the MySQL root Password. After Successful Logon, the information indicating successful logon is displayed, and you can proceed to the next step.
3. Enter the command in the command line: update MySQL. user set password = PASSWORD ('new password') where User = 'root ';
This operation aims to change the password of the root user.
4. Enter flush privileges in the command line;
This operation aims to update the MySQL permission table.
The above content describes the solution to forgetting the MySQL root Password under the win server, hoping to help you in this regard.