Record a slow mysql connection
The problem is as follows:
I started a mysql instance on a machine (61.183.23.23) and activated an account to access it from 127.0.0.1 or 61.183.23.23. However, one problem is that the access speed varies greatly when the following two command lines are used:
Mysql-h 127.0.0.1-u user
Mysql-h 61.183.23.23-u user
Then I use ping to determine that the speed of the two IP addresses is almost the same.
Using 127.0.0.1 is faster than the other one. Although 61.183.23.23 needs to go to the Internet for a lap, how is the speed difference so much.
Solution:
Mysql uses skip-name-resolve to disable DNS queries.
Mysql performs DNS lookup on the client IP address during user logon. Whether you log on using an IP address or a domain name, this lookup process is ongoing. Therefore, if the DNS of the server where your mysql is located has a problem or the quality is poor, it may cause this problem and DNS resolution problems.
Modify the mysql configuration file
[Mysqld]
Skip-name-resolve