A solution for remote connection failure of MySQL

Source: Internet
Author: User

Http://blog.csdn.net/wenbingcai/article/details/2401858

1. MySQL remote connection is slow or cannot be connected at all
2. log on to the MySQL console locally and show processlist. Many processes are displayed, similar
| 145 | unauthenticated user | 61.129.57.158: 1672 | null | connect | null | login | null |
| 146 | unauthenticated user | 222.73.4.114: 1250 | null | connect | null | login | null |
| 147 | unauthenticated user | 222.73.19.148: 48308 | null | connect | null | login | null |
3. Frequent failure to stop MySQL

Solution
The reason for the above situation is that
When the MySQL server receives a remote IP address access, it will check the reverse resolution of the IP address by default.
This lookup process will be slow. If the IP address is not reversed, MySQL may also be stuck in this connection.
As a result, a large number of connections in the connect status appear in MySQL, affecting MySQL usage.

There are two solutions to prevent this problem.
1. Add a line of skip-name-resolve in the [mysqld] section of my. CNF to skip reverse resolution.
2. Write the remote IP address in the/etc/hosts file, so that reverse resolution can be quickly found during reverse resolution.

Related Article

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.