线上有个数据库,在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: 1SET timestamp=1377237368;# administrator comman
线上有个数据库,在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: 1SET timestamp=1377237368;# administrator command: Binlog Dump;
每完成一次binlog dump都会被记录下来,看着非常不爽(我有强迫症,O(∩_∩)O哈哈~),得想着法子搞掉。
经过排查,最后确认是特定版本存在这个现象,目前发现官方 5.1.49-log MySQL Community Server (GPL) 存在,估计整个官方 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 TA<p>本文来源gao!%daima.com搞$代*!码9网(</p>BLE, ANALYZE TABLE, CHECK TABLE, CREATE INDEX, DROP INDEX, OPTIMIZE TABLE, and REPAIR TABLE.
手册也有不靠谱的时候啊,还是实践出真知。
原文地址:[MySQL FAQ]系列 — slow log中出现大量的binlog dump记录, 感谢原作者分享。