binlog_expire_logs_seconds

Overview

In 11.4 ES, 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 11.4 ES, 10.6 ES:

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

In 10.5 ES, 10.4 ES:

Not present

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.

SYNONYMS

SCHEMA

PARAMETERS

Command-line

--binlog_expire_logs_seconds=#

Configuration file

Supported

Dynamic

Yes

Scope

Global

Data Type

BIGINT UNSIGNED

Minimum Value

0

Maximum Value

8553600

Product Default Value

0

SKYSQL

Cloud

SkySQL Topology

ES Ver

Service Default

AWS

Multi-Node Analytics

10.6

0

Single Node Analytics

10.6

0

Replicated Transactions

10.4

Not present

10.5

Not present

10.6

345600

Single Node Transactions

10.4

Not present

10.5

Not present

10.6

345600

GCP

Multi-Node Analytics

10.6

0

Single Node Analytics

10.6

0

Replicated Transactions

10.4

Not present

10.5

Not present

10.6

345600

Single Node Transactions

10.4

Not present

10.5

Not present

10.6

345600

Cloud

SkySQL Topology

ES Ver

Service Default

AWS

ColumnStore Data Warehouse

10.6

0

Enterprise Server With Replica(s)

10.4

Not present

10.5

Not present

10.6

345600

Enterprise Server Single Node

10.4

Not present

10.5

Not present

10.6

345600

GCP

ColumnStore Data Warehouse

10.6

0

Enterprise Server With Replica(s)

10.4

Not present

10.5

Not present

10.6

345600

Enterprise Server Single Node

10.4

Not present

10.5

Not present

10.6

345600

PRIVILEGES

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 |
+----------------------------+-----------+

ERROR HANDLING

FEATURE INTERACTION

RESPONSES

DIAGNOSIS

ISO 9075:2016

CHANGE HISTORY

Release Series

History

11.4 Enterprise

  • Not present.

10.6 Enterprise

  • Added in MariaDB Enterprise Server 10.6.4-1.

10.6 Community

  • Added in MariaDB Community Server 10.6.1.

10.5 Enterprise

  • Not present.

10.5 Community

  • Not present.

10.4 Enterprise

  • Not present.

10.4 Community

  • Not present.

10.3 Enterprise

  • Not present.

10.3 Community

  • Not present.

10.2 Enterprise

  • Not present.

10.2 Community

  • Not present.

Release Series

History

11.4 Enterprise

  • Not present.

10.6 Enterprise

  • Added in MariaDB Enterprise Server 10.6.4-1.

10.5 Enterprise

  • Not present.

10.4 Enterprise

  • Not present.

EXTERNAL REFERENCES