Binary Logs for MariaDB Community Server 10.4
This page is part of MariaDB's Documentation.
The parent of this page is: Logging for MariaDB Community Server 10.4
Topics on this page:
Overview
MariaDB Community Server 10.4 writes statements and transactions to its binary logs.
Reference material is available for MariaDB Community Server 10.4.
Purpose
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
Format
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_
[mariadb]
log_bin = mariadb-bin
binlog_format = ROW
Location
By default, binary logging is disabled.
You can determine the binary log's file name and location by querying the log_
SHOW GLOBAL VARIABLES
LIKE 'log_bin_basename';
Configuration
Several aspects of the binary log are configurable.
Configure the Path
The path to the binary logs is configured by the log_
The option can be set in a configuration file:
[mariadb]
log_bin=mariadbd-bin
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_
[mariadb]
log_bin=/binary_logs/mariadbd-bin
If the log_HOSTNAME-bin
, where HOSTNAME
is the system's host name:
[mariadb]
# base name on the system's host name
log_bin
Configure the Format
The format used for the binary log is configured by the binlog_
The system variable can be set in a configuration file:
[mariadb]
binlog_format=ROW