Record a slow mysql connection

Source: Internet
Author: User
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

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.