`
zhang_ly520
  • 浏览: 159061 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

(转)Got an error reading communication packets mysql

阅读更多

经常会有使用mysql的朋友会发现error.log中有大量的
[Warning] Aborted connection 。。。。。(Got an error reading communication packets)
对于这样的警告日志,大致从下面两个方面排查
1网络问题,网络是否存在问题,花费了超过 connect_timeout 的时间去得到一个数据包
2账号密码是否正确
3客户端是否有权限连接该数据库
4连接包是不是有带有正确的信息

如果都不是上面的问题,可以尝试加大max_allowed_packet_size,或者使用php的短连接,不使用长连接,再或者每次查询完成后关闭连接,避免The client had been sleeping more than wait_timeout or interactive_timeout seconds without issuing any requests to the server.(客户端连接休眠时间超过wait_timeout,interactive)
实在没招了,可以大概general query log,把所有查询的sql都列出来。
还是解决不了,就是更底层的原因了,网络设备故障等等。详细见参考


参考http://dev.mysql.com/doc/refman/5.1/en/communication-errors.html

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics