[root@calldb3 data]# tail -f mysql.error
2018-11-26T22:13:12.884160Z 4928033 [Note] Aborted connection 4928033 to db: 'calldb' user: 'call' host: '172.31.50.220' (Got an error reading communication packets)
2018-11-26T22:13:12.884160Z 4928083 [Note] Aborted connection 4928083 to db: 'calldb' user: 'call' host: '172.31.50.220' (Got an error reading communication packets)
2018-11-26T22:13:12.884172Z 4848700 [Note] Aborted connection 4848700 to db: 'calldb' user: 'call' host: '172.31.50.220' (Got an error reading communication packets)
2018-11-26T22:13:21.228059Z 4771072 [Note] Aborted connection 4771072 to db: 'calldb' user: 'call' host: '172.31.50.221' (Got an error reading communication packets)
2018-11-26T22:13:21.228081Z 4926711 [Note] Aborted connection 4926711 to db: 'calldb' user: 'call' host: '172.31.50.221' (Got an error reading communication packets)
2018-11-26T22:13:21.228084Z 4928159 [Note] Aborted connection 4928159 to db: 'calldb' user: 'call' host: '172.31.50.221' (Got an error reading communication packets)
2018-11-26T22:13:21.228213Z 4926592 [Note] Aborted connection 4926592 to db: 'calldb' user: 'call' host: '172.31.50.221' (Got an error reading communication packets)
2018-11-27T00:23:08.438660Z 4968411 [Note] Aborted connection 4968411 to db: 'calldb' user: 'call' host: 'vpn.g5air.com' (Got timeout reading communication packets)
2018-11-27T00:23:24.822669Z 4968419 [Note] Aborted connection 4968419 to db: 'calldb' user: 'call' host: 'vpn.g5air.com' (Got timeout reading communication packets)
mysql> show variables like '%log_time%';
+----------------+-------+
| Variable_name | Value |
+----------------+-------+
| log_timestamps | UTC |
+----------------+-------+
1 row in set (0.00 sec)

注意到日志时间显示不正确,故需改成北京时间

mysql> SET GLOBAL log_timestamps = SYSTEM;
Query OK, 0 rows affected (0.00 sec) mysql> show variables like '%log_time%';
+----------------+--------+
| Variable_name | Value |
+----------------+--------+
| log_timestamps | SYSTEM |
+----------------+--------+
1 row in set (0.00 sec)

修改之后如下。日志好看多了

2018-11-27T09:23:11.153618+08:00 4974498 [Note] Aborted connection 4974498 to db: 'hcalldb' user: 'hcall' host: '172.31.86.43' (Got an error reading communication packets)
2018-11-27T09:26:22.312188+08:00 4974583 [Note] Aborted connection 4974583 to db: 'hcalldb' user: 'hcall' host: '172.31.86.43' (Got an error reading communication packets)

解决 “Got an error reading communication packets” 问题

mysql> show global status like '%abort%';
+------------------+-------+
| Variable_name | Value |
+------------------+-------+
| Aborted_clients | 6644 |
| Aborted_connects | 66042 |
+------------------+-------+
2 rows in set (0.00 sec)

  

Aborted_clients #表示有一个连接的mysql客户端被连接被kill的数量,MYSQL认为读到了一个错误的包,并将该连接Aborted

模拟:

在linux下打开多个客户端,每个客户端登录mysql,然后我们在其中的一个linux客户端下,强制kill其他mysql客户端登录进程,同时监控error_log情况,即可出现上面日志情况。

Aborted_connects #表示有客户端因为密码或其他什么原因登录失败的数量

解决mysql日志显示时间和“Got an error reading communication packets” 问题的更多相关文章

  1. MySQL错误日志显示(Got an error reading communication packets)的问题

    错误显示: 2019-05-28T12:54:08.267934+08:00 820396 [Note] Aborted connection 820396 to db: 'Databaseplatf ...

  2. mysql5.7日志时间戳(log_timestmaps)与系统时间不一致问题以及日志报Got an error reading communication packets情况分析

    一.mysql安装后error_log日志时间戳默认为UTC(如下图),因此会造成与系统时间不一致,与北京时间相差8个小时. 解决errro_logs时间戳与linux系统时间不一致问题 step1: ...

  3. MySQL ERROR Got an error reading communication packets

    200 ? "200px" : this.width)!important;} --> 介绍 经常会在错误日志中看到这个报错,首先我们可以从show GLOBAL statu ...

  4. 翻译:MySQL "Got an Error Reading Communication Packet" Errors

    前言: 本文是对Muhammad Irfan的这篇博客MySQL "Got an Error Reading Communication Packet" Errors的翻译,如有翻 ...

  5. Got timeout reading communication packets解决方法

    Got timeout reading communication packets解决方法 http://www.th7.cn/db/mysql/201702/225243.shtml [Note] ...

  6. Spring Boot程序插入时间和MySQL数据库显示时间不一样(设置数据库时区)

    首先查看数据库时区 show variables like "%time_zone%"; # 设置全局时区 mysql> set global time_zone = '+8 ...

  7. 解决mysql无法显示中文/MySQL中文乱码问号等问题

    一般都是编码格式问题 显示编码格式: show variables like'character_set_%'; 将其中Value不是utf8的改为utf8: set character_set_cl ...

  8. [ci] jenkins的Timestamper插件-让日志显示时间

    jenkins的Timestamper插件-让jenkins console带时间戳 安装插件 配置pipline,使用timestamp - 官网有说怎么用: 即用timestamps{} 包裹所有 ...

  9. mysql日志体系大盘点

    MySql日志文件主要包含:错误日志.慢查询日志.事务日志.二进制日志等 Mysql的日志配置可以通过命令 show global variables like '%log%'; 执行的结果如下 &q ...

随机推荐

  1. Nginx实现tomcat集群进行负载均衡

    一.背景 随着业务量和用户数量的激增,单一的tomcat部署应用已经无法满足性能需求,而且对于每次发布项目期间服务不可用的问题也凸显,既然出现了这个问题,那么我们本文就借助nginx来完美的解决这个问 ...

  2. PHP多进程系列笔记(五)

    前面几节都是讲解pcntl扩展实现的多进程程序.本节给大家介绍swoole扩展的swoole_process模块. swoole多进程 swoole_process 是swoole提供的进程管理模块, ...

  3. 复刻smartbits的国产网络测试工具minismb-如何测试协议限速

    复刻smartbits的网络性能测试工具MiniSMB,是一款专门用于测试智能路由器,网络交换机的性能和稳定性的软硬件相结合的工具.可以通过此工具测试任何ip网络设备的端口吞吐率,带宽,并发连接数和最 ...

  4. java Multimap

    实现 { "a": [ , , ], "b": [ , ] } 当然, HashMap<String, List<Integer>> 是 ...

  5. JGraphT

    例1: 添加点.边 import java.net.*; import org.jgrapht.*; import org.jgrapht.graph.*; /** * A simple introd ...

  6. offsetHeight,scrollHeight,clientHeight,scrollTop以及pageX,clientX,offsetX,screenX,offsetLeft,style.left等的区别以及使用详解

    一.写在前面 在阅读本文前,希望大家能针对每个属性亲手测试,网上现有的大量相关博客都有不等的概念错误,毕竟亲手实践才能更好的掌握这些概念. 1.pageX,clientX,screenX与offset ...

  7. android开发学习笔记系列(5)--fragment与viewpage

    前言 在前面的博客写到我针对一个项目完成了动态布局的效果,顿时感觉很爽,那么下面我针对我在前文中所讲的tabhost的实现做出一个新的方法,tabhost基本已经被启用,现在基本使用Fragment与 ...

  8. 对类型“DevExpress.Xpf.Grid.GridControl”的构造函数执行符合指定的绑定约束的调用时引发了异常。

    用VS2012 修改别人的WPF代码时碰到这个问题,百度下有人遇到相同问题,不过版本不同,先试下再说. 解决方法:安装Netframework4.5的补丁 地址:http://support.micr ...

  9. Microsoft Office MIME Types

    经常需要查找Microsoft Office MIME Types,终于在MSDN网上找到,摘录如下,以备查阅与参考:http://blogs.msdn.com/b/vsofficedeveloper ...

  10. webpack与gulp的区别

    gulp是工具链.构建工具,可以配合各种插件做js压缩,css压缩,less编译 替代手工实现自动化工作 1.构建工具 2.自动化 3.提高效率用 webpack是文件打包工具,可以把项目的各种js. ...