First, start the command line.
1. Run:Taskkill/f/im mysqld-nt.exe
The following operations operate some programs in the bin directory of mysql. If no environment variables are configured, switch to the bin directory of mysql and execute the following statements. Otherwise, it is invalid.
2. Continue to run in the command line:Mysqld-nt -- skip-grant-tables
3. Open a new command line to run: mysql-u root (if the bin environment variable of mysql is not configured, switch to the bin directory to execute this statement)
If you don't want to change the password, you just want to check the original password. You can execute this statement on the command line.
Select host, user, password from mysql. user; // you can view the user and password.
If you want to change the password, execute the following statement in the command line.
Update mysql. user set password = 'Enter the password you want to set here 'where user = 'root ';
Here I have set a blank password.
After completing these operations, continue to run on the command line
Taskkill/f/im mysqld-nt.exe; // security considerations, end first, because now this can be directly logged on with mysql-u root
Net start mysql; // start the mysql Service
At this point, the root password of mysql is forgotten.
I am also a cainiao. In this process, there may be some low-level problems. I hope you will give some comments. Only when I find my own faults can I make progress. I want to fly because I have inserted wings to my cainiao.