Disable MySQL DNS reverse resolution (unauthenticated user solution)

Source: Internet
Author: User

By default, mysql will automatically reverse parse. If we cannot handle the problem, we will find a large number of unauthenticated user prompts when viewing show processlist, the following describes how to solve unauthenticated user.

Example

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 |

How many unauthenticated users try to log on to mysql? R. When this happens unlimitedly, the system will be very slow.

I learned from the official mysql website that this is a special setting on an official system. I thought of it as a mysql bug. No matter whether the link is through the hosts or IP mode, he will reverse query the DNS. mysqld will try to reverse query the IP address-> dns, because reverse query resolution is too slow, you cannot cope with excessive queries.


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

Solution:
1. execution:

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

Ii. Modify the MySQL configuration file my. cnf
Append:

The 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.