Solution to the problem that mysql cannot connect to the database with skip-name-resolve, skipnameresolve
Mysql cannot be linked with skip-name-resolve,
Check whether MySql has used host name authorization.
Add the following two lines to the MySql Server configuration file My. ini:
[Mysqld]
Skip-name-resolve
It will prohibit MySql Server from performing DNS resolution on external connections. Using this option can eliminate the time for MySql to perform DNS resolution.
However, if this option is enabled, IP addresses are required for all remote host connection authorizations. Otherwise, MySQL cannot process connection requests normally.
If the skip-name-resolve option is enabled, make sure that MySql has used host name authorization,
Run the following command in mysql:
Mysql> select user, host from mysql. user where host <> 'localhost ';
Generally, you will get a record with "%" authorization (that is, any address:
If no record exists, the condition is not met. You need to change the localhost to 127.0.0.1.
Mysql cannot be connected when skip-name-resolve is added. After modification, restart mysql.
If the host name is "DB1" "DB2", delete the hostanme record in the authorization table and restart mysqld.