mysql問題之slow log中出現大量的binlog dump記錄的解決方案_Mysql

來源:互聯網
上載者:User
線上有個資料庫,在slow log中,存在大量類似下面的記錄:

複製代碼 代碼如下:

# Time: 130823 13:56:08
# User@Host: repl[repl] @ slave [10.x.x.x]
# Query_time: 9.000833 Lock_time: 0.000000 Rows_sent: 1 Rows_examined: 1
SET timestamp=1377237368;
# administrator command: Binlog Dump;


每完成一次binlog dump都會被記錄下來,看著非常不爽(我有強迫症,O(∩_∩)O哈哈~),得想著法子搞掉。
經過排查,最後確認是特定版本存在這個現象,目前發現官方 5.1.49 存在,估計整個官方 5.1.x 都會有這個現象。

解決方案:

修改 my.cnf 設定檔,增加或修改下面這個選項:

複製代碼 代碼如下:

log-slow-admin-statements = 0


比較坑人的是,這個選項在5.1無法線上修改,需要重啟mysqld。
手冊上關於這個選項的解釋如下:

複製代碼 代碼如下:

Include slow administrative statements in the statements written to the slow query log. Administrative statements include ALTER TABLE, ANALYZE TABLE, CHECK TABLE, CREATE INDEX, DROP INDEX, OPTIMIZE TABLE, and REPAIR TABLE.


手冊也有不靠譜的時候啊,還是實踐出真知。

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.