Mysql version:5.1.73
Os Version:centos 5.9
Description of the problem:
Today a PHP program from the client connection MySQL is monitored to the occasional connection process error, the information is as follows:
Lost connection to MySQL server at ' reading authorization packet ' , see this error prompt, the first thought is that the client connection is not, the server can connect locally. Verified that the server side local can be connected, this is a sigh of relief, on the one hand there are many tasks are running on the MySQL server, if the local can not connect, will cause most programs blocked;
On the other hand, the server can be connected, it can be related to check the problem.
with Show Processlist When I look at the connection, I find that the number of connections is not too high, and it is not concurrency, but there is a value that is conspicuous:
unauthenticateduser, and error messages similar to unauthenticated users.
Check the relevant information, the explanation is: "unauthenticated user" is a client-initiated connection, but this client user has not been certified. This is generally the case when the system load is high or MySQL is busy.
See the connection is not high, see that there may be a high load will also lead to this problem, and then looked under the machine load, the load is not high .....
There's one more parameter to mention, it's skip-name-resolve .. WhenClient connection, the server side will be in the client in DNS will be counter-checkto obtain the domain name or hostname of the client. andSkip-name-resolveThe meaning of this parameter is to prohibit reverse domain name parsing. Then I wonder if it willThere was a problem with the DNS server that caused the connection to authenticate the user.
Then I looked at the skip-name-resolve state .
At this point the Skip-name-resolve parameter has been set. The question can be taken out of the past.
Then found OS-level monitoring outside the network Gigabit network card has traffic alerts. Then found a problem, the PHP program for MySQL access (hundreds of times per second select) is based on the external network, resulting in excessive traffic. And then looked under the intranet network card, gigabit, hehe, decisive to the network-based access to move to the inside of the internet ... Observe a period of time, the connection is relieved, the problem is not happening .....
! Remember the network adapter caused by the MySQL connection exception!
Lost connection to MySQL Server at ' reading authorization packet ' handling workaround