Failed to write to mysql.slow_log
2023-09-11 14:13:57 时间
最近将一MySQL数据库的系统变量log_output从file调整为table后,偶尔会收到告警邮件,告警邮件内容为:
Failed to write to mysql.slow_log。
查了一下这个问题,发现居然是一个Bug,其实出现这个错误是因为慢查询的SQL语句太长,导致插入mysql.slow_log系统表时超过字段的长度,所以在错误日志当中出现"Failed to write to mysql.slow_log"信息。官方文档的Bug信息为Bug #37132 Logging to slow_log table fails with very slow queries。 摘抄其中一段描述内容如下:
Fixed in 8.0.17.
Logging to the mysql.slow_log system table could fail when values
were to large for table columns. Now logging proceeds on a
best-effort basis, writing what information can be provided.
Otherwise, the row is discarded and a message is written to the error log.
这个Bug直到MySQL 8.0.17才被Fix掉,在这之前从未碰到过,第一次遇到也颇感意外,遇到了就记录一下!
参考资料:
https://bugs.mysql.com/bug.php?id=37132
相关文章
- mysql约束
- 【Mysql 学习】mysql 字符集
- 【MySQL】MetaData Lock 之二
- 【MySQL】HEX,UNHEX 用例一则
- Mybatis+MySQL动态分页查询数据经典案例(含代码以及测试)
- Navicat for MySQL出现#1045 错误怎么办
- XtraBackup出现 Can't connect to local MySQL server through socket '/tmp/mysql.sock'
- mysql describe
- PHP连接MySQL数据库的三种方式(mysql、mysqli、pdo)--续
- ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (111)
- MYSQL错误解决:ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
- 大叔经验分享(86)hive和mysql数据互导
- MySQL · 引擎新特性 · 可开关的InnoDB死锁检测
- Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result
- Mysql索引数据结构有多个选择,为什么一定要是B+树呢?_面试 (MySQL 索引为啥要选择 B+ 树)
- 21分钟 MySQL 入门教程
- linux下 安装mysql教程
- MySQL Study之--Mysql无法启动“mysql.host”
- 安全测试===Mysql 注入技巧学习 MySQL注入技巧(1)
- MySQL-mysql 8.0.11安装教程 windows
- ELASTIC SEARCH学习笔记(四)----与传统数据库(MYSQL)的比较
- MySQL备份和还原单库与单表
- Mysql之安全清理mysql-slow.log
- 【MySql】MySQL数据库--什么是MySQL的回表 ?
- MySQL 一文带你详解 mysql binlog
- 提高MySQL数据可靠性的必备技能:基于MySQL8实现主从同步
- Win10解决Android Studio:Gradle sync failed: Failed to open zip file.