#How to solve the 1045 error when Navicat connects to mysql?
1045 appears when using Navicat to connect to mysql. The possible reason is that the password has been forgotten.
The following methods can help reset the password:
1. Run the cmd program with administrator rights;
2. cd C: \Program Files (x86)\MySQL\MySQL Server 5.7\bin
3. Close the mysqld process,
>>tasklist |findstr mysqld This line of command can be used to check whether mysqld is in Run, you can check its PID during operation
>>taskkill /F /PID xxxx
Related recommendations: "Navicat for mysql graphic tutorial"
4. Skip permissions to log in to the MySQL server>>mysqld --skip -grant-tables
Close cmd, re-run cmd with administrator rights
5, change 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;Find the authentication_string item of the root user and write down its value
##>>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 1862 is prompted, change the password and connect again. >>mysqladmin -uroot -p password##Test the connection again,
You're done!
The above is the detailed content of How to solve error 1045 when navicat connects to mysql. For more information, please follow other related articles on the PHP Chinese website!