解决mysql日志显示时间和“Got an error reading communication packets” 问题
[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” 问题的更多相关文章
- MySQL错误日志显示(Got an error reading communication packets)的问题
错误显示: 2019-05-28T12:54:08.267934+08:00 820396 [Note] Aborted connection 820396 to db: 'Databaseplatf ...
- mysql5.7日志时间戳(log_timestmaps)与系统时间不一致问题以及日志报Got an error reading communication packets情况分析
一.mysql安装后error_log日志时间戳默认为UTC(如下图),因此会造成与系统时间不一致,与北京时间相差8个小时. 解决errro_logs时间戳与linux系统时间不一致问题 step1: ...
- MySQL ERROR Got an error reading communication packets
200 ? "200px" : this.width)!important;} --> 介绍 经常会在错误日志中看到这个报错,首先我们可以从show GLOBAL statu ...
- 翻译:MySQL "Got an Error Reading Communication Packet" Errors
前言: 本文是对Muhammad Irfan的这篇博客MySQL "Got an Error Reading Communication Packet" Errors的翻译,如有翻 ...
- Got timeout reading communication packets解决方法
Got timeout reading communication packets解决方法 http://www.th7.cn/db/mysql/201702/225243.shtml [Note] ...
- Spring Boot程序插入时间和MySQL数据库显示时间不一样(设置数据库时区)
首先查看数据库时区 show variables like "%time_zone%"; # 设置全局时区 mysql> set global time_zone = '+8 ...
- 解决mysql无法显示中文/MySQL中文乱码问号等问题
一般都是编码格式问题 显示编码格式: show variables like'character_set_%'; 将其中Value不是utf8的改为utf8: set character_set_cl ...
- [ci] jenkins的Timestamper插件-让日志显示时间
jenkins的Timestamper插件-让jenkins console带时间戳 安装插件 配置pipline,使用timestamp - 官网有说怎么用: 即用timestamps{} 包裹所有 ...
- mysql日志体系大盘点
MySql日志文件主要包含:错误日志.慢查询日志.事务日志.二进制日志等 Mysql的日志配置可以通过命令 show global variables like '%log%'; 执行的结果如下 &q ...
随机推荐
- JAVA与DOM解析器基础 学习笔记
要求 必备知识 JAVA基础知识.XML基础知识. 开发环境 MyEclipse10 资料下载 源码下载 文件对象模型(Document Object Model,简称DOM),是W3C组织推荐的 ...
- OSRM笔记
OSRM OSRM(OpenStreetMap Routeing Machine)可用于路线规划.作为高性能的路线规划引擎,OSRM使用C++14编写,基于开源的OpenStreetMap数据实现. ...
- 浅谈tcp socket的backlog参数
最近看netty源码碰到ChannelOption.SO_BACKLOG参数,通过跟踪代码发现其实是用于设置底层tcp socket的backlog参数,由于不了解这个参数,有必要彻底的理解一下. 底 ...
- WPF中Grid的行的Height和列的Width根据内容自适应
Grid中RowDefinition的Height和ColumnDefinition的设置都有三种: 1. 具体数值,固定不变: 2. * 星号,如: 2*,5*,8*: 分母为(2+5+8=15), ...
- PTA (Advanced Level) 1008 Elevator
Elevator The highest building in our city has only one elevator. A request list is made up with Npos ...
- 数据结构与算法(周鹏-未出版)-第六章 树-6.5 Huffman 树
6.5 Huffman 树 Huffman 树又称最优树,可以用来构造最优编码,用于信息传输.数据压缩等方面,是一类有着广泛应用的二叉树. 6.5.1 二叉编码树 在计算机系统中,符号数据在处理之前首 ...
- git第二节----git clone与git tag
@git 远程克隆(clone)仓库,将远程工程clone到本地仓库:默认克隆远程master 分支 git clone https://github.com/kaokaozhu/Test.git ...
- 【LeetCode题解】3_无重复字符的最长子串(Longest-Substring-Without-Repeating-Characters)
目录 描述 解法一:暴力枚举法(Time Limit Exceeded) 思路 Java 实现 Python 实现 复杂度分析 解法二:滑动窗口(双指针) 思路 Java 实现 Python 实现 复 ...
- 回头再看看babel的实现原理
一.前言 babel在大家的工作中应该没少用,但是为什么它能将ES6转成ES5呢?一个有态度的前端er肯定会想抛开迷雾,看看其中的奥秘. 记得很早前自己有去了解过相关方面的内容,但是时间久远,现在已是 ...
- Ant Trip(区别于二分匹配中最小路径覆盖的一笔画问题)
题目链接: http://acm.hdu.edu.cn/showproblem.php?pid=3018 题目: Problem Description Ant Country consist of ...