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 |