navicat for MySQL has a 1045 error when connecting to the local database, as shown below:
Indicates that the database password is incorrect when connecting to mysql and needs to be modified. The problem can be solved only after entering the password.
Related recommendations: "Navicat for mysql graphic tutorial"
The solution steps are as follows:
1 , First open the command line: Start->Run->cmd;
2. First enter the bin directory of mysql installed on the computer (the installation path of your own software). If it is the C drive, you can directly execute the command : mysql -u root mysql;
3. After entering mysql, execute the command: UPDATE user SET Password=PASSWORD('newpassword') where USER='root';
4. If 1820 is reported If there is an error, execute the command: ALTER USER USER() IDENTIFIED BY 'New Password', it will prompt Query OK, indicating that the password has been modified successfully;
5. If a 1054 error is reported as shown in the figure below, then change the command The statement is: update user set authentication_string=password('root') where user='root'; that's it.
Because there is no password field in the mysql database, the password field is changed to authentication_string.
#6. After completion, execute the command: quit or exit to exit mysql.
ps: If a 1064 error is reported during the execution of the command, it may be a syntax error. Pay attention to check whether there are any errors in your sql statement.
The above is the detailed content of What should I do if navicat connection error 1045 is reported?. For more information, please follow other related articles on the PHP Chinese website!