1045 error when Navicat connects to mysql

1045 appears when using Navicat to connect to mysql. The possible reason is that the password is forgotten. The following methods can help reset the password.

 

 

1. Run the cmd program with administrator privileges;

2,cd C:\Program Files (x86)\MySQL\MySQL Server 5.7\bin

3. Close the mysqld process,

>>tasklist |findstr mysqld This command can be used to check whether mysqld is running, and its PID can be checked during running

>>taskkill /F /PID xxxx xxxx is the PID value obtained from the previous command

4. Skip permissions to log in to the MySQL server side

>>mysqld --skip-grant-tables

Close cmd and run cmd again with administrator privileges

5. Change the password

>>cd C:\Program Files (x86)\MySQL\MySQL Server 5.7\bin

>>mysql

 

>>update mysql.user set authentication_string=password('123456') where user = 'root';

>>flush privileges;
 
>>SELECT * from mysql.user\G;
找到root用户的authentication_string这项,并把它的值记下来

>>update mysql.user set authentication_string = '*6BB4837EB74329105EE4568DDA7DC67ED2CA2AD9' where user = 'root';here user = 'root';

>>flush privileges;
>>quit

6, restart mysql

>>net start mysql

7, try to connect, if prompted 1862

Connect again after changing the password

>>mysqladmin -uroot -p password

Connect test again

 

 

 

 

Related Posts