ERROR Message :
081016 23:25:44 Aborted connection 31084472 to db: ‘ms’ user: ‘login’ host: `x.x.x.12′ (Got timeout reading communication packets)
081016 23:25:44 Aborted connection 31084391 to db: ‘ms’ user: ‘login’ host: `x.x.x.13′ (Got timeout reading communication packets)
081016 23:25:44 Aborted connection 31084488 to db: ‘ms’ user: ‘login’ host: `x.x.x.15′ (Got timeout reading communication packets)
081016 23:25:44 Aborted connection 31084509 to db: ‘ms’ user: ‘login’ host: `x.x.x.15′ (Got timeout reading communication packets)
081016 23:25:45 Aborted connection 31084518 to db: ‘ms’ user: ‘login’ host: `x.x.x..11′ (Got an error reading communication packets)
可以导致Got timeout reading communication packets错误的原因
https://dev.mysql.com/doc/refman/5.5/en/communication-errors.html
可能导致Got Timeout reading communication packets错误的原因有如下几个:
A client attempts to access a database but has no privileges for it.(没有权限)
A client uses an incorrect password.(密码错误)
A connection packet does not contain the right information.(连接没有包含正确信息)
It takes more than connect_timeout seconds to obtain a connect packet. (获取连接信息起过connect_timeout的时长)
The client program did not call mysql_close() before exiting.(客户端没有调用mysql_close()函数)
The client had been sleeping more than wait_timeout or interactive_timeout seconds without issuing any requests to the server. (客户端的空连接时间过长,超过了wait_timeout和interactive_timeout的时间)
The client program ended abruptly in the middle of a data transfer.(数据传输过程中终结)
>show global status like '%abort%';
+------------------+--------+
| Variable_name | Value |
+------------------+--------+
| Aborted_clients | 921470 |
| Aborted_connects | 2877 |
+------------------+--------+
2 rows in set (0.01 sec)
aborted_connects (尝试连接)连接账号密码错误,还有telnet 也会增加此值
aborted-clients (建立好的连接)可能是超时time out导致
>show variables like '%max_connect%%';
+--------------------+---------+
| Variable_name | Value |
+--------------------+---------+
| max_connect_errors | 1000000 |
| max_connections | 1024 |
+--------------------+---------+
2 rows in set (0.00 sec)
max_connect_errors 是一个MySQL中与安全有关的计数器值,它负责阻止过多尝试失败的客户端以防止暴力破解密码的情况,max_connect_errors的值与性能并无太大关系.设置过小,网页可能提示无法连接数据库服务器.
解决办法:
flush hosts,其实就是刷新连接的主机列表host list cache,当这一客户端成功连接一次MySQL服务器后,针对此客户端的max_connect_errors会清零.
防止正常应用被blocked之后,不能允许连接not allowed connect.
建议:
1.刷新一次 flush hosts
2.加大 max-connection-error值比如10万
浙公网安备 33010602011771号