binlog_expire_logs_seconds
This page is part of MariaDB's Enterprise Documentation.
The parent of this page is: System Variables for MariaDB Enterprise Server
Topics on this page:
Overview
- In 10.6 ES, 10.6 CS:
If non-zero, binary logs will be purged after binlog_expire_logs_seconds seconds; It and expire_logs_days are linked, such that changes in one are converted into the other. Possible purges happen at startup and at binary log rotation.
- In 10.5 ES, 10.5 CS, 10.4 ES, 10.4 CS, 10.3 ES, 10.3 CS, 10.2 ES, 10.2 CS:
Not present
See also: System Variables for MariaDB Enterprise Server 10.6, in 10.6 CS, in 10.5 ES, in 10.5 CS, in 10.4 ES, in 10.4 CS, in 10.3 ES, in 10.3 CS, in 10.2 ES, and in 10.2 CS
USAGE
The binlog_expire_logs_seconds
system variable can be set in a configuration file:
[mariadb]
binlog_expire_logs_seconds=21600
The global value of the binlog_expire_logs_seconds
system variable can also be set dynamically at runtime by executing SET GLOBAL:
SET GLOBAL binlog_expire_logs_seconds=21600;
When the binlog_expire_logs_seconds
system variable is set dynamically at runtime, its value will be reset the next time the server restarts. To make the value persist on restart, set it in a configuration file too.
DETAILS
The binlog_expire_logs_seconds
system variable can be used to configure the binlog expiration period with a temporal resolution of 1 second.
In versions with the binlog_expire_logs_seconds
system variable, the expire_logs_days system variable is linked to the binlog_expire_logs_seconds
system variable:
When the
binlog_expire_logs_seconds
system variable is set, the specified value in seconds is converted to the corresponding number of days, and the resulting floating point value is set to the expire_logs_days system variable.When the expire_logs_days system variable is set, the specified value in days is converted to the corresponding number of seconds, and the resulting integer value is set to the
binlog_expire_logs_seconds
system variable.
Prior to this feature, the expire_logs_days system variable only supported integer values, so the binary log expiration period could only have a temporal resolution of 1 day.
PARAMETERS
Command-line | --binlog_expire_logs_seconds=# |
Configuration file | Supported |
Dynamic | Yes |
Scope | Global |
Data Type | BIGINT UNSIGNED |
Minimum Value | 0 |
Maximum Value | 8553600 |
Default Value | 0 |
EXAMPLES
SET GLOBAL binlog_expire_logs_seconds = 43200;
SHOW VARIABLES LIKE '%expire_logs%';
+----------------------------+----------+
| Variable_name | Value |
+----------------------------+----------+
| binlog_expire_logs_seconds | 43200 |
| expire_logs_days | 0.500000 |
+----------------------------+----------+
SET GLOBAL expire_logs_days = 10;
SHOW VARIABLES LIKE '%expire_logs%';
+----------------------------+-----------+
| Variable_name | Value |
+----------------------------+-----------+
| binlog_expire_logs_seconds | 864000 |
| expire_logs_days | 10.000000 |
+----------------------------+-----------+
CHANGE HISTORY
Release Series | History |
---|---|
10.6 Enterprise |
|
10.6 Community |
|
10.5 Enterprise |
|
10.5 Community |
|
10.4 Enterprise |
|
10.4 Community |
|
10.3 Enterprise |
|
10.3 Community |
|
10.2 Enterprise |
|
10.2 Community |
|
EXTERNAL REFERENCES
Information specific to MariaDB SkySQL can be found on the binlog_expire_logs_seconds page in the SkySQL Documentation.