Navicat keeps reporting 1405 errors when connecting to the mysql database. The following is the solution for this:
Related recommendations: " Navicat for mysql graphic tutorial》
MySQL server is running, stop it. If the server is running as a Windows service, go to Computer Management --->Services and Applications------>Services. If the server is not running as a service, you may need to use Task Manager to force stop it.
Create a text file (named mysql-init.txt here) and place the following commands on a single line Medium: SET PASSWORD FOR 'root'@'localhost' = PASSWORD('MyNewPassword');
(note that the file we created is imported into the bin in the MySql installation directory Directory D:\progame\bin) progame is my own MySql directory, be careful not to make errors [it is the sql in your own installation directory]
When the server starts, execute The contents of the file named by the "--init-file" option (function: read SQL commands from the specified file at startup), change the root user password. When the server starts successfully, the mysql-init.txt file we imported should be deleted.
Finally stop the MySQL server and then restart it. [Note that to run the server in automatic mode, you should start it from the Windows service window. If you started the server manually, you can use the commands as normal. 】Then I found that I was connected to the database.
The above is the detailed content of What should I do if navicat fails to connect to mysql?. For more information, please follow other related articles on the PHP Chinese website!