ITPub博客

首页 > 数据库 > MySQL > Got timeout reading communication packets

Got timeout reading communication packets

原创 MySQL 作者:甲骨文技术支持 时间:2017-11-28 21:06:43 0 删除 编辑

环境:CentOS release 6.5 (Final),MySQL:5.7.12

在error.log日志里有如下的提示,太多了,容易让人看不到重要的信息,所以打算屏蔽掉。


  1. 11-28T19:20:55.658970+08:00 878538 [Note] Aborted connection 878538 to db: 'xxxx' user: 'oms_rw' host: 'xxx.xx.169.125' (Got timeout reading communication packets)
  2. 2017-11-28T19:21:31.417245+08:00 878728 [Note] Aborted connection 878728 to db: 'xxxx' user: 'oms_rw' host: 'xxx.xx.165.95' (Got timeout reading communication packets)
  3. 2017-11-28T19:21:31.728802+08:00 878635 [Note] Aborted connection 878635 to db: 'xxxx' user: 'oms_rw' host: 'xxx.xx.165.95' (Got timeout reading communication packets)
  4. 2017-11-28T19:21:42.780035+08:00 878504 [Note] Aborted connection 878504 to db: 'xxxx' user: 'oms_rw' host: 'xxx.xx.165.95' (Got timeout reading communication packets)
  5. 2017-11-28T19:21:52.114134+08:00 878279 [Note] Aborted connection 878279 to db: 'xxxx' user: 'oms_rw' host: 'xxx.xx.165.95' (Got timeout reading communication packets)
  6. 2017-11-28T19:22:12.843467+08:00 878736 [Note] Aborted connection 878736 to db: 'xxxx' user: 'oms_rw' host: 'xxx.xx.165.95' (Got timeout reading communication packets)
  7. 2017-11-28T19:22:42.750175+08:00 879051 [Note] Aborted connection 879051 to db: 'xxxx' user: 'oms_rw' host: 'xxx.xx.165.95' (Got timeout reading communication packets)
  8. 2017-11-28T19:22:42.887395+08:00 878825 [Note] Aborted connection 878825 to db: 'xxxx' user: 'oms_rw' host: 'xxx.xx.169.125' (Got timeout reading communication packets)
  9. 2017-11-28T19:23:21.989617+08:00 879318 [Note] Aborted connection 879318 to db: 'xxxx' user: 'oms_rw' host: 'xxx.xx.165.95' (Got timeout reading communication packets)
  10. 2017-11-28T19:23:42.769896+08:00 879407 [Note] Aborted connection 879407 to db: 'xxxx' user: 'oms_rw' host: 'xxx.xx.165.95' (Got timeout reading communication packets)
  11. 2017-11-28T19:23:42.870136+08:00 879454 [Note] Aborted connection 879454 to db: 'xxxx' user: 'oms_rw' host: 'xxx.xx.169.125' (Got timeout reading communication packets)
  12. 2017-11-28T19:23:52.125260+08:00 879071 [Note] Aborted connection 879071 to db: 'xxxx' user: 'oms_rw' host: 'xxx.xx.165.95' (Got timeout reading communication packets)
  13. 2017-11-28T19:23:55.656959+08:00 879511 [Note] Aborted connection 879511 to db: 'xxxx' user: 'oms_rw' host: 'xxx.xx.56.98' (Got timeout reading communication packets)
  14. 2017-11-28T19:24:12.842803+08:00 879537 [Note] Aborted connection 879537 to db: 'xxxx' user: 'oms_rw' host: 'xxx.xx.169.125' (Got timeout reading communication packets)
从参数log_warnings入手

  1. mysql> show global variables like '%log_warning%';
  2. +---------------+-------+
  3. | Variable_name | Value |
  4. +---------------+-------+
  5. | log_warnings | 2 |
  6. +---------------+-------+
  7. 1 row in set (0.00 sec)
看下这个参数的官方解释:

log_warnings is enabled by default (the default is 1 before MySQL 5.7.2, 2 as of 5.7.2). To disable it, set it to 0. If the value is greater than 0, the server logs messages about statements that are unsafe for statement-based logging. If the value is greater than 1, the server logs aborted connections and access-denied errors for new connection attempts. See Section B.5.2.10, “Communication Errors and Aborted Connections”.

恰恰我这边设置的为2,把它修改为1:

  1. set global log_warnings=1;
修改后在error.log里面这些提示消失了。

最后要注意的是log_warnings在未来的版本中会弃用,由另一个参数log_error_verbosity替代。








来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/20893244/viewspace-2147893/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论
2009年获得Oracle OCM认证,ITPUB社区OCM联盟成员,熟悉Oracle,mysql,Python,Zabbix等。

注册时间:2016-12-31

  • 博文量
    143
  • 访问量
    570485