What if MySQL forgets the password?
1. Turn off the MySQL service.
2. Create a new c:\my-init.txt text file, reset your new password to NewPassword, as follows:
UPDATE mysql.user SET password=password (' newpassword ') WHERE user= ' root '; FLUSH privileges;
3. Open a new command line and enter the command as shown (this is installed by the MySQL wizard, so you can do it):
The path of the My.ini file is pressed to get:
Run the contents of the command line, you can modify the new password.
To unzip the installation directly, press the following command:
C:\> C:\mysql\bin\mysqld--init-file=c:\\mysql-init.txt
4. Through the client to test, to see if the modification succeeds, if unsuccessful, check the command line in detail if there is any wrong input.
5. After success, the Mysqld.exe is closed by the work manager and then the MySQL service is started at the service.
MySQL forgot password, how to reset the new password (mysql5.6 has been tested OK)