# binlog_format

> Whether the binary log stores statements, row changes, or a mix.

Source: https://sqlly.app/sql-configuration/mysql/binlog-format
Last updated: 2026-11-30
License: Text and data [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) (credit SQLly, sqlly.app); code and SQL snippets [MIT](https://opensource.org/license/mit). [Details](https://sqlly.app/license).

**Default**

`ROW`

**Range**

ROW, STATEMENT, MIXED

**Restart needed**

No

**Default checked on**

MySQL 8.4 LTS

## What it does

ROW writes the rows each statement changed, STATEMENT writes the SQL text, and MIXED switches to row logging when a statement is not safe to log as text. Row-based is the default, and 8.4 deprecates the variable itself: the manual says only row-based logging should be used for new replication setups.

## Default value

`ROW`. ROW since MySQL 5.7.7 and still the value in MySQL 8.4, where the variable is deprecated and non-ROW values are subject to removal.

## Check the current value

```
SHOW GLOBAL VARIABLES LIKE 'binlog_format';

SELECT VARIABLE_NAME, VARIABLE_SOURCE, MIN_VALUE, MAX_VALUE, SET_TIME
FROM performance_schema.variables_info
WHERE VARIABLE_NAME = 'binlog_format';
```

## Change it

```
SET SESSION binlog_format = 'ROW';   -- this connection
SET GLOBAL binlog_format = 'ROW';    -- new connections, until restart
SET PERSIST binlog_format = 'ROW';   -- new connections, and after restarts
```

No restart. SET GLOBAL (or SET PERSIST, which also survives restarts) applies to connections opened afterwards; existing connections keep their session value unless they SET it themselves.

## When to change it

Almost never in 8.4. Servers upgraded from old versions that still run STATEMENT should move to ROW, one replica at a time, because the alternatives are deprecated.

## What can go wrong

Statement-based logging replays statements, so their effects can differ on the replica: an UPDATE tied to LIMIT without ORDER BY is the classic unsafe case. READ COMMITTED isolation refuses statement-based logging, and row filters and GTID-oriented tooling assume ROW.

## Questions about binlog_format

### What is the default value of binlog_format in MySQL?

ROW. ROW since MySQL 5.7.7 and still the value in MySQL 8.4, where the variable is deprecated and non-ROW values are subject to removal.

### Does changing binlog_format require a restart?

No. No restart. SET GLOBAL (or SET PERSIST, which also survives restarts) applies to connections opened afterwards; existing connections keep their session value unless they SET it themselves.

### When should I change binlog_format?

Almost never in 8.4. Servers upgraded from old versions that still run STATEMENT should move to ROW, one replica at a time, because the alternatives are deprecated.

Back to all [MySQL settings](https://sqlly.app/sql-configuration/mysql), or check the [MySQL manual](https://dev.mysql.com/doc/refman/8.4/en/server-system-variables.html) for every option.

## Related MySQL settings

- [`log_bin` Whether the binary log is enabled.](https://sqlly.app/sql-configuration/mysql/log-bin)
- [`binlog_row_image` How many columns a row-based binary log event records.](https://sqlly.app/sql-configuration/mysql/binlog-row-image)
- [`transaction_isolation` Default transaction isolation level.](https://sqlly.app/sql-configuration/mysql/transaction-isolation)
