MySQL in Windows State:
Steps:
Prepare the data:
If you have saved the MySQL address to an environment variable, you will not need to enter the MySQL path in the DOS command window every time.
If this is not done, then each time you enter the DOS command window.
The path where MySQL is located is as follows:
If you forget the path to MySQL, then you can enter the following command: WIN+R---->cmd--->services.msc appears as follows, and finds out:
Right click on MySQL, properties, the following page appears:
The specific implementation steps are as follows:
On the basis above: input: Mysqld-nt--skip-grant-tables
The Mysqld.exe process is closed and a new command window is opened:
Input: MySQL
See the page above, it means that you have successfully entered the MySQL.
Next: Show databases; query all databases.
Next: Use MySQL------->show tables
Next: If you are unfamiliar with the fields in the user table, you can go to the table to see
Use user;
Select User,host,password from user;
Finally, you can change the password based on the corresponding field.
Update user Set password = ' password you want to set ' from user;
Finally, open mysql,net start MySQL, you can log in according to the username and password you set.
MySQL password forgot the workaround