MySQL remote connection very slow solution

Source: Internet
Author: User

Today due to accidental login MySQL server (the MySQL server is equipped with phpMyAdmin) to view the process (show processlist), I went to a large number of unauthorized users to connect to MySQL, the process results are as follows:


|13|unauthenticated user|10.135.26.100:42345| null| Connect| |login| null|

|14|unauthenticated user|10.135.26.100:42346| null| Connect| |login| null|

|15|unauthenticated user|10.135.26.100:42349| null| Connect| |login| null|


I have a go, this is the shrimp situation? Asked Baidu Google, the reason is: MySQL turned on the DNS reverse resolution, seemingly default installation will appear this dongdong. Problems found, natural problems will be solved.


1. Add--skip-name-resolve in startup parameter, turn off reverse Domain name resolution function
2. Increased skip-name-resolve in the [mysqld] section of MY.CNF
3. Add the corresponding host record in the/etc/hosts file
For convenience, add Skip-name-resolve in the [mysqld] section of f in the MySQL configuration file my.cnf, using scenario 2 directly. Option to disable DNS resolution, the connection speed is much faster. However, in this way, you cannot use the hostname in the MySQL authorization table, but only in IP format.

Using the –skip-grant-tables system will not make any access control to any user's access, but you can use mysqladmin flush-privileges or mysqladmin reload to open access control; The databases statement is open to all users,

If the MySQL server does not open a remote account, add Skip-grant-tables to the MY.CNF.


In Linux, the profile is/ETC/MY.CNF, and the configuration file under Windows is the My.ini file under the MySQL installation directory. Note that the configuration is added under [mysqld], after you change the configuration and save, then restart MySQL and connect to the test remotely, and everything is back to the same. The official explanation information for this parameter is as follows:

MySQL host query DNS is slow or a lot of client hosts will cause the connection is very slow, because our development machine is not able to connect the extranet, so DNS resolution is impossible, so also understand why the connection so slow. Also, note that after adding this configuration parameter, the Host field in the MySQL authorization table will not be able to use the domain name and can only use the IP address, because this is the result of the Forbidden Domain resolution

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.