[Warning] Aborted connection 162746 to db: (Got an error reading communication packets)
in DatabaseBlogMySQL with 0 comment

[Warning] Aborted connection 162746 to db: (Got an error reading communication packets)

in DatabaseBlogMySQL with 0 comment

这几天发现VPS上的mysql数据库告警日志里报了很多如下错误:

2017-04-10 05:37:49 14557 [Warning] Aborted connection 162746 to db: 'bigbiglife' user: 'bigbiglife' host: 'localhost' (Got an error reading communication packets)

虽然不是大问题,但是对于处女座的我,不能忍!

我这个问题可能是PHP连接MySQL后超过wait_timeout设置的时间限制被kill后造成的。
详情可以看https://dev.mysql.com/doc/refman/5.7/en/communication-errors.html

If a client is unable even to connect, the server increments the Aborted_connects status variable. Unsuccessful connection attempts can occur for the following reasons:

If a client successfully connects but later disconnects improperly or is terminated, the server increments the Aborted_clients status variable, and logs an Aborted connection message to the error log. The cause can be any of the following:

Other reasons for problems with aborted connections or aborted clients:

下面是我修改后参数,观察一段时间先:

[root@shunzi ~]# grep -E 'max_allowed_packet|wait_timeout|interactive_timeout' /etc/my.cnf
wait_timeout                    = 600
interactive_timeout             = 600
max_allowed_packet              = 32M
Responses
点击这里给我发消息
嘿!有什么能帮到您的吗?