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