Turn off MySQL's DNS reverse resolution (unauthenticated user solution)

Source: Internet
Author: User

Cases

The code is as follows Copy Code

Mysql>show processlist;

| 20681949 | Unauthenticated user | a.b.c.d:52497 | NULL | Connect | | Reading from net | NULL |
| 20681948 | Unauthenticated user | w.x.y.z:52495 | NULL | Connect | | Reading from net | NULL |

Found that there are a lot of unauthenticated users trying to do login using MySQL, and when this happens indefinitely it can cause the system to be very slow.

Access to the MySQL official website that this is an official system on the special settings, he is a MySQL as a bug to forget. Regardless of the way the link is through the hosts or IP mode, he will do the DNS back-check mysqld will try to reverse IP-> DNS, because the reverse analysis too slow, it will not be able to cope with excessive inquiries.


If a large number of illegal users attempt to log on to MySQL on the public web, the load to the server is unimaginable.

Solution:
First, implementation:

The code is as follows Copy Code
#/usr/local/mysql/bin/mysqld_safe--skip-name-resolve--user=mysql&

Second, modify the MySQL configuration file my.cnf
Additional:

  code is as follows copy code
[mysqld]
Skip-name-resolve
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.