Limiting the disk space used by binary log files¶
It is a challenge to control how much disk space is used by the binary logs. The size of a binary log can vary because a single transaction must be written to a single binary log and cannot be split between multiple binary log files.
|Uses the command line||Yes|
|Uses the configuration file||Yes|
|Default value||0 (unlimited)|
|Maximum value - 64-bit platform||18446744073709547520|
This variable places an upper limit on the total size in bytes of all binary logs. When the limit is reached, the oldest binary logs are purged until the total size is under the limit or only the active log remains.
The default value of
0 disables the feature. No limit is set on the log space. The binary logs accumulate indefinitely until the disk space is full.
binlog_space_limit to 50 GB in the
[mysqld] ... binlog_space_limit = 50G ...