Solve the unauthenticateduser error in MySQL

Source: Internet
Author: User
Recently, I found that two MySQLserver instances were suddenly worried at noon (suddenly) and were continuously suspended. Restarting mysql also fails. You can only view the errorlog of mysql.

Recently, I found that two MySQL servers suddenly went viral at noon (suddenly) and kept failing. Restarting mysql also fails. You can only view the errorlog of mysql.

Recently, I found that two MySQL servers suddenly went viral at noon (suddenly) and kept failing. Restarting mysql also fails. You can only see information similar to the following:

Forcing close of thread 12232 user: 'root'

Use mysqladmin to easily monitor mysql:

Mysqladmin-uroot-p ******** status-I 1

It is found that Queries per second avg is only about 200, which can be said to be very low, but Threads is indeed very unstable, and it will actually upgrade more than 200 instantly. In general, this thread value will not be higher than 5 single digits!

Then continue reading

Mysqladmin-uroot-p ********* processlist

Is there a large number of unauthenticated users ?? The following situations

+ ------ + ----------- + --------- + ---- + --------- + ------ + ------- + ------------------ +
[Root @ app028 ~] # Mysqladmin-uroot-p ************** processlist
+ ------ + ----------- + --------- + ---- + --------- + ------ + ------- + ------------------ +
| Id | User | Host | db | Command | Time | State | Info |
+ ------ + ----------- + --------- + ---- + --------- + ------ + ------- + ------------------ +
| 2007 | unauthenticated user | 192.168.4.29: 58519 | Connect | login |
| 2008 | unauthenticated user | 192.168.4.29: 58553 | Connect | login |
| 2009 | unauthenticated user | 192.168.4.29: 58571 | Connect | login |
| 2010 | unauthenticated user | 192.168.4.29: 58577 | Connect | login |
| 2011 | unauthenticated user | 192.168.4.29: 58579 | Connect | login |
| 2012 | unauthenticated user | 192.168.4.29: 58589 | Connect | login |

Google,

MySQL finds that this is a bug in MySQL. no matter whether the connection is through hosts or ip address, MySQL will reverse query the DNS and IP address to the DNS, because the reverse query speed is too slow (no matter whether it is a problem with the dns server provided by the isp or other reasons), a large number of queries are hard to cope with, and threads are increased when they are not enough, but it cannot be released, so MySQL will be "suspended ".

The solution is simple. End the reverse lookup process and prohibit any parsing.

Open the mysql configuration file (my. cnf) and add a line under [mysqld:

Skip-name-resolve

Reload the configuration file or restart the MySQL service.

Another example:

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.