The mysql problem has a large number of binlog dump record solutions in slow log

  • 2020-06-01 11:09:46
  • OfStack

There is a database online, and in slow log, there are a lot of records like this:

 
# 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; 


Every time I complete binlog dump, it will be recorded. I feel very uncomfortable (I have ocd, O(∩_∩)O haha ~). I have to figure out how to do it.
After investigation, it was finally confirmed that this phenomenon exists in a specific version. At present, it has been found that this phenomenon exists in official 5.1.49. It is estimated that this phenomenon will occur in the whole official 5.1.x.

Solutions:

Modify the my.cnf configuration file to add or modify the following option:

 
log-slow-admin-statements = 0 


Unfortunately, this option cannot be modified online in 5.1, so you need to restart mysqld.
The manual explains this option as follows:

 
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. 


Manual also has not reliable time, still practice comes true knowledge.

Related articles: