您的位置:首页 > 数据库 > MySQL

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

2016-05-26 10:29 591 查看
When Does MySQL Rotate the Binary Log
(Doc ID 1937268.1)

To
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参数

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息