Binary Logs for MariaDB Community Server 10.4


MariaDB Community Server 10.4 writes statements and transactions to its binary logs.

Reference material is available for MariaDB Community Server 10.4.


The binary logs are intended for:

  • Replicating statements and transactions to replica nodes using MariaDB Replication

  • Performing point-in-time recovery (PITR)

  • Analyzing data changes with mariadb-binlog


The binary log uses a binary format. The mariadb-binlog utility is capable of displaying the contents in a human-readable format.

The binary log supports row-based logging, statement-based logging, and a mixed mode. In the mixed mode, most statements are logged in statement-based format, while some "unsafe" statements are written in row-based format.

The binary log format is configured by the binlog_format system variable:

log_bin = mariadb-bin
binlog_format = ROW


By default, binary logging is disabled.

You can determine the binary log's file name and location by querying the log_bin_basename system variable:

   LIKE 'log_bin_basename';


Several aspects of the binary log are configurable.

Configure the Path

The path to the binary logs is configured by the log_bin option.

The option can be set in a configuration file:


The binary logs will be created in the data directory defined by the datadir system variable.

The binary logs can be placed outside of the data directory by setting the log_bin option to the absolute path of the desired location:


If the log_bin option is set, but no value is provided, the prefix for the binary logs is set to HOSTNAME-bin, where HOSTNAME is the system's host name:

# base name on the system's host name

Configure the Format

The format used for the binary log is configured by the binlog_format system variable.

The system variable can be set in a configuration file: