Failed to write to mysql.slow_log


 

   最近将一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


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM