> For the complete documentation index, see [llms.txt](https://mariadb.com/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://mariadb.com/docs/server/server-management/server-monitoring-logs/binary-log.md).

# Binary Log

The binary log (binlog) contains a record of all changes to the databases.

{% columns %}
{% column %}
{% content-ref url="/pages/kuyea9gT5hNPGHVXbPDP" %}
[Overview of the Binary Log](/docs/server/server-management/server-monitoring-logs/binary-log/overview-of-the-binary-log.md)
{% endcontent-ref %}
{% endcolumn %}

{% column %}
Introduction to the purpose and structure of the binary log, explaining how it records data changes (DML[^1]) and structure changes (DDL[^2]) for replication and recovery.
{% endcolumn %}
{% endcolumns %}

{% columns %}
{% column %}
{% content-ref url="/pages/vqefnTqlf1glPvk0aYqm" %}
[Activating the Binary Log](/docs/server/server-management/server-monitoring-logs/binary-log/activating-the-binary-log.md)
{% endcontent-ref %}
{% endcolumn %}

{% column %}
Instructions for enabling the binary log using the `--log-bin` option and configuring the log file basename and index file.
{% endcolumn %}
{% endcolumns %}

{% columns %}
{% column %}
{% content-ref url="/pages/ZFDrpWDoDA1U8EHqZ6PT" %}
[Binary Log Formats](/docs/server/server-management/server-monitoring-logs/binary-log/binary-log-formats.md)
{% endcontent-ref %}
{% endcolumn %}

{% column %}
Detailed comparison of the three binary logging formats: Statement-based (SBR), Row-based (RBR), and Mixed, including their pros, cons, and configuration via binlog\_format.
{% endcolumn %}
{% endcolumns %}

{% columns %}
{% column %}
{% content-ref url="/pages/zX38VwLVlwTtEm3hDQB8" %}
[Using and Maintaining the Binary Log](/docs/server/server-management/server-monitoring-logs/binary-log/using-and-maintaining-the-binary-log.md)
{% endcontent-ref %}
{% endcolumn %}

{% column %}
Complete binary log maintenance: `PURGE BINARY LOGS`/`RESET MASTER`, `expire_logs_days` & `binlog_expire_logs_seconds`, `FLUSH BINARY LOGS`, and `SHOW SLAVE STATUS`.
{% endcolumn %}
{% endcolumns %}

{% columns %}
{% column %}
{% content-ref url="/pages/1bex9emVSd5NMSmWw2uI" %}
[InnoDB-Based Binary Log](/docs/server/server-management/server-monitoring-logs/binary-log/innodb-based-binary-log.md)
{% endcontent-ref %}
{% endcolumn %}

{% column %}
MariaDB 12.3 introduces a new binary log implementation that stores binlog events directly in InnoDB-managed tablespaces instead of separate files on disk.
{% endcolumn %}
{% endcolumns %}

{% columns %}
{% column %}
{% content-ref url="/pages/YfoCL1C0v9KukvK4Z09D" %}
[Compressing Events to Reduce Size of the Binary Log](/docs/server/server-management/server-monitoring-logs/binary-log/compressing-events-to-reduce-size-of-the-binary-log.md)
{% endcontent-ref %}
{% endcolumn %}

{% column %}
Guide to using the `log_bin_compress` system variable to compress binary log events, reducing storage usage and network bandwidth during replication.
{% endcolumn %}
{% endcolumns %}

{% columns %}
{% column %}
{% content-ref url="/pages/dCDrNv10MLuc0rwkPX1A" %}
[Flashback](/docs/server/server-management/server-monitoring-logs/binary-log/flashback.md)
{% endcontent-ref %}
{% endcolumn %}

{% column %}
Explains how to use the Flashback feature (via `mysqlbinlog --flashback`) to rollback transactions by reversing the binary log events, useful for recovering from accidental data modifications.
{% endcolumn %}
{% endcolumns %}

{% columns %}
{% column %}
{% content-ref url="/pages/fqkVqeMYKVjge7gZXy2e" %}
[Group Commit for the Binary Log](/docs/server/server-management/server-monitoring-logs/binary-log/group-commit-for-the-binary-log.md)
{% endcontent-ref %}
{% endcolumn %}

{% column %}
Describes the group commit optimization, which improves performance by committing multiple transactions to the binary log in a single disk I/O operation.
{% endcolumn %}
{% endcolumns %}

{% columns %}
{% column %}
{% content-ref url="/pages/mjmnasaAzw3Obn9xu80p" %}
[Relay Log](/docs/server/server-management/server-monitoring-logs/binary-log/relay-log.md)
{% endcontent-ref %}
{% endcolumn %}

{% column %}
Overview of the relay log, a set of log files created by a replica server to store events received from the primary's binary log before executing them.
{% endcolumn %}
{% endcolumns %}

{% columns %}
{% column %}
{% content-ref url="/pages/Y6AvRI5Mhpbaa9psw54H" %}
[Selectively Skipping Replication of Binlog Events](/docs/server/server-management/server-monitoring-logs/binary-log/selectively-skipping-replication-of-binlog-events.md)
{% endcontent-ref %}
{% endcolumn %}

{% column %}
Learn techniques to bypass specific replication events. This guide explains how to ignore individual transactions or errors to restore replication flow after a stoppage.
{% endcolumn %}
{% endcolumns %}

[^1]: DML (Data Manipulation Language): The subset of SQL commands used to add, modify, retrieve, or delete data within existing database tables.

[^2]: DDL (Data Definition Language): The subset of SQL commands used to create, modify, or destroy the structure of database objects (like tables, indexes, and databases) rather than the data itself.
