Error description:
When using navicat to connect to the mysql database, it will appear: mysql error 2005 - Unknown MySQL server host 'localhost' (0) error; when checking the connection information, connection attribute information, user name and password are correct, the IP address is: localhost, the database can be opened normally when there is a network, but when the network is disconnected, error.
Related recommendations: "Navicat for mysql graphic tutorial"
The solution is as follows:
Create using navicat When connecting to mysql, fill in the host or IP address column: 127.0.0.1 instead of localhost. Then test it when the network is disconnected and you will find that the connection can be successful.
Error reason:
When there is a network, localhost will be automatically resolved to 127.0.0.1. When the network is disconnected, localhost is just a string. Represents an ip address.
The above is the detailed content of What does the error 2005 mean when using navicat connection?. For more information, please follow other related articles on the PHP Chinese website!