MySQL connection is slow.

Source: Internet
Author: User
Tags reverse dns

MySQL connection is slow.

Problem: Recently, the IP address is changed because the server has changed the network segment. After the change, the MySQL client is used to connect to the MySQL server and open the table on the client is very slow (regardless of the table size ), even if the connection times out, but directly log on to the server to connect to MySQL locally, the speed is normal.

Cause:After the MySQL database receives a network connection, it first obtains the IP address of the other party, and then performs reverse DNS resolution on the IP address to obtain the host name corresponding to the IP address. Use the host name in the permission system for permission determination. Reverse DNS resolution is time-consuming and may make users feel slow. Sometimes, if the host name resolved in reverse direction does not point to this IP address, the connection will fail.

Solution:

To avoid this lookup process, you can append the following configuration under [mysqld] of MySQL configuration file my. cnf:
[Mysqld]
Skip-name-resolve


The following information is provided for reference:

1. MySQL DNS lookup results in slow connection

2. MySQL DNS reverse resolution causes connection timeout

3. Slow SSH connection and reverse resolution

Related Article

E-Commerce Solutions

Leverage the same tools powering the Alibaba Ecosystem

Learn more >

Apsara Conference 2019

The Rise of Data Intelligence, September 25th - 27th, Hangzhou, China

Learn more >

Alibaba Cloud Free Trial

Learn and experience the power of Alibaba Cloud with a free trial worth $300-1200 USD

Learn more >

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.