max_binlog_size
默认就是一个G最大值,但是有有什么会发现超过了一个G
原因就是:
If a write to the binary log causes the current log file size to exceed the value of this variable, the server rotates the binary logs (closes the current file and opens the next one). The minimum value is 4096 bytes. The maximum and default value is 1GB. Encrypted binary log files have an additional 512-byte header, which is included in max_binlog_size.
A transaction is written in one chunk to the binary log, so it is never split between several binary logs. Therefore, if you have big transactions, you might see binary log files larger than max_binlog_size.
如果有一个事务超级大,超过了1个G,它并不会备切分,而是存放在一个binlog日志中,那么这个日志大大小就会超过1G。通常情况下,我们要避免出现超大事务,避免对系统造成影响。