Home > Database > Mysql Tutorial > [MySQL FAQ]系列 -- slow log中出现大量的binlog dump记录

[MySQL FAQ]系列 -- slow log中出现大量的binlog dump记录

WBOY
Release: 2016-06-07 16:38:47
Original
1080 people have browsed it

线上有个数据库,在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: 1
SET timestamp=1377237368;
# administrator command: Binlog Dump;
Copy after login

每完成一次binlog dump都会被记录下来,看着非常不爽(我有强迫症,O(∩_∩)O哈哈~),得想着法子搞掉。
经过排查,最后确认是特定版本存在这个现象,目前发现官方 5.1.49-log MySQL Community Server (GPL) 存在,估计整个官方 5.1.x 都会有这个现象。

解决方法:
修改 my.cnf 配置文件,增加或修改下面这个选项:

log-slow-admin-statements = 0
Copy after login

比较坑人的是,这个选项在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.
Copy after login

手册也有不靠谱的时候啊,还是实践出真知。

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template