解决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】类加载器
在Java中主要有一下三种类加载器; Booststrap ClassLoader:此加载器采用C++编写,一般开发中是看不到的: Extendsion ClassLoader:用来进行扩展类的加载, ...
- Yum软件包管理详解
目录 1. Yum 1.1 检查和更新包 1.1.1 查询更新 1.1.2 更新包 1.1.3 使用 ISO 和 Yum 离线升级系统 1.2 使用包 1.2.1 搜索包 1.2.2 列出包 1.2. ...
- How to correctly handle ThreadLocal.get() returning null
Java's ThreadLocals make certain things easy, but special care must be taken to make sure they are r ...
- java Queue的用法
https://www.cnblogs.com/caozengling/p/5307992.html https://blog.csdn.net/a724888/article/details/802 ...
- Linux-(telnet,wget)
telnet命令 telnet命令通常用来远程登录.telnet程序是基于TELNET协议的远程登录客户端程序.Telnet协议是TCP/IP协议族中的一员,是Internet远程登陆服务的标准协议和 ...
- ant jmeter 优化报告
一:主要内容 报告展示,该报告利用的jmeter.results.shanhe.me.xsl里面加入了自己写的部分代码,优化了展示效果 下载安装ant 修改jmeter.properties 下载jm ...
- 微信小程序——豆瓣电影——(1):基础入门
准备 Demo 项目地址 https://github.com/zce/weapp-demo Clone or Download(需准备GIT环境) $ cd path/to/project/root ...
- nginx 跳转系列
1.nginx强制跳转https配置,通过http状态吗实现,http状态吗地址: https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/3 ...
- Deep learning with Python 学习笔记(4)
本节讲卷积神经网络的可视化 三种方法 可视化卷积神经网络的中间输出(中间激活) 有助于理解卷积神经网络连续的层如何对输入进行变换,也有助于初步了解卷积神经网络每个过滤器的含义 可视化卷积神经网络的过滤 ...
- 使用netfilter_queue改包笔记
系统:centos 7 准备:安装libnetfilter_queue模块,可以yum安装,也可以网上下载rpm包安装 简介:使用iptables在NAT表上创建DNAT与SNAT规则,对数据包进行转 ...