When Does MySQL Rotate the Binary Log (Doc ID 1937268.1)

来源:互联网 发布:淘宝特卖商城 编辑:程序博客网 时间:2024/06/05 11:35
To BottomTo Bottom

In this Document

Goal Solution References


APPLIES TO:

MySQL Server - Version 4.1 and later
Information in this document applies to any platform.

GOAL

Learn when MySQL rotates the binary log.

 

SOLUTION

There are several conditions that trigger the binary log to be rotated: >>下面列出的是会触发mysql进行binlog轮换的几个条件

  • The binlog size is greater than max_binlog_size.  >>当binlog size 大于max_binlog_size指定值时
  • MySQL is restarted.                                                       >>当mysql实例重启时
  • Execute the FLUSH [BINARY] LOGS command.     >>当执行FLUSH [BINARY] LOGS命令时
    FLUSH LOGS closes and reopens all log files. If binary logging is enabled, the sequence number of the binary log file is incremented by one relative to the previous file.
     flush logs命令会close 所有log files,如果你启用了binlog,那么执行该命令时会使binlog日志发生轮换
  • Backup using mysqldump with --flush-logs (-F) option  >>在使用mysqldump 进行数据库备份时指定了--flush-logs参数
0 0
原创粉丝点击