[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. 利用cygwin创建windows下的crontab定时任务

    要求 必备知识 熟悉基本编程环境搭建. 运行环境 windows 7(64位); Cygwin-1.7.35 下载地址 环境下载 什么是Cygwin Cygwin是一个在windows平台上运行的类U ...

  2. MySQL和Mariadb二进制日志binlog详解

    Mariadb/mysql提供了4中不同的日志,分别是错误日志(error.log).普通日志(general log).慢日志(slow log)以及二进制日志(binlog).错误日志记录了系统启 ...

  3. 编写无Java脚本的JSP页面

    在上一章中总结了Web开发中应用MVC架构模式,将Servlet 用做控制器,JSP作为视图,JavaBean作为模型,实现业务流程控制,页面逻辑和业务逻辑的分离.然而,使用前面的技术实现MVC,并不 ...

  4. Double与BigDecimal 精度问题

    转自:http://superivan.iteye.com/blog/963628 [1] 精确的浮点运算: 在Java里面,有时候为了保证数值的准确性需要精确的数据,先提供一个例子就可以发现问题了: ...

  5. BIO与NIO、AIO的区别(这个容易理解)

    转自:http://blog.csdn.net/skiof007/article/details/52873421 BIO与NIO.AIO的区别(这个容易理解) IO的方式通常分为几种,同步阻塞的BI ...

  6. 代码部署工具walle(一)

    一.概述 代码部署上线.权限控制.一键版本回滚,github地址:https://github.com/meolu/walle-web walle是基于php语言做的,所以需要一个php的安装环境. ...

  7. [开源] .NET数据库ORM类库 Insql

    介绍 新年之际,给大家介绍个我自己开发的ORM类库Insql.TA是一个轻量级的.NET ORM类库 . 对象映射基于Dapper , Sql配置灵感来自于Mybatis.简单优雅性能是TA的追求. ...

  8. C#Redis集合set

    快过年了,任务也没那么多了,可以有时间了解下其他的内容,今天看到一个博客关于weex的,觉得还挺实用的,等有空了可以了解了解.不过还是把今年的目标要完成.今天继续redis. 一.前戏 在Redis中 ...

  9. 并发编程——ConcurrentHashMap#addCount() 分析

    前言 ConcurrentHashMap 精华代码很多,前面分析了 helpTransfer 和 transfer 和 putVal 方法,今天来分析一下 addCount 方法,该方法会在 putV ...

  10. 并发编程之 ConcurrentLinkedQueue 源码剖析

    前言 今天我们继续分析 java 并发包的源码,今天的主角是谁呢?ConcurrentLinkedQueue,上次我们分析了并发下 ArrayList 的替代 CopyOnWriteArrayList ...