Problem status: Recently because the server transformed the network segment, resulting in IP address transformation, after changing the use of MySQL client connection to the MySQL server and open the table in the client is very slow (regardless of the size of the table), even the connection time-out, but directly log on to the server locally connected to MySQL, the speed is normal.
Problem reason:MySQL database received a network connection, first get the other's IP address, and then the IP address of the reverse DNS resolution to get this IP address corresponding host name. Use the host name in the permission system to determine the permissions. Reverse DNS parsing is time-consuming and may make users feel slow. Even sometimes, the reverse resolution of the host name does not point to this IP address, this time can not be connected successfully.
Solution:
To avoid this process, you can append the following configuration to the MySQL configuration file my.cnf [mysqld]:
[Mysqld]
Skip-name-resolve
The following information is provided here for your reference:
1.MySQL DNS counter-check causes slow connection
2.MySQL DNS Reverse resolution causes connection timeouts
3.SSH connection slow and reverse resolution
MySQL connection slow, turn slow cause