Solutions for MySql Error Code 1045 (windows)

1. Run cmd as administrator   

2. Enter the bin directory in the MYSQL installation directory through the command line mode. (Note: My business is installed in the "C:\Program Files\MySQL\MySQL Server 5.6\bin" directory by default) The command line is shown in the figure:

3. Execute net stop mysql56 to stop the mysql service

4. Execute mysqld-nt --skip-grant-tables in the current directory, this is the current command line window will not move, reopen a new command line here to enter the same directory as before, execute the mysql command, and enter the msql> mode.

5. Enter use mysql and press Enter to display database chengd

6. update user set Password=PASSWOED ('your new password') where user='root';

7. Refresh database command: FLUSH PRIVILEGES;

8. Restart the database: net start mysql56

9. It can be used normally

 

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326653341&siteId=291194637