// mysql · wal, redo & durability

binlog_row_image

How many columns a row-based binary log event records.

默认
FULL
Range
FULL, MINIMAL, NOBLOB
Restart needed
否
Default checked on
MySQL 8.4 LTS

作用

Each row change carries a before image for finding the row and an after image with the new values. FULL records every column in both; MINIMAL records only the identifying columns plus those that changed; NOBLOB records everything except BLOB or TEXT columns the statement did not touch.

默认值

FULL. FULL (MySQL 8.4).

Check the current value

SHOW GLOBAL VARIABLES LIKE 'binlog_row_image';

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

Change it

SET SESSION binlog_row_image = 'MINIMAL';   -- this connection
SET GLOBAL binlog_row_image = 'MINIMAL';    -- new connections, until restart
SET PERSIST binlog_row_image = 'MINIMAL';   -- 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

On high-write replicas where binlog size and network transfer matter, with wide tables holding large BLOB or TEXT columns that rarely change.

What can go wrong

Smaller images shrink the log and the network cost, but the replica must then match rows with fewer columns, so every replicated table needs a primary key or unique index to be updated reliably. Use the same value on every server in the topology, as the manual recommends.

Questions about binlog_row_image

What is the default value of binlog_row_image in MySQL?

FULL. FULL (MySQL 8.4).

Does changing binlog_row_image 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_row_image?

On high-write replicas where binlog size and network transfer matter, with wide tables holding large BLOB or TEXT columns that rarely change.

Back to all MySQL settings, or check the MySQL manual for every option.

// one client for every engine

Check binlog_row_image on your own server

SQLly runs the query above against MySQL and the other engines in this reference, from one desktop app on macOS, Windows and Linux.

本页文字和数据: CC BY 4.0,请注明出处 SQLly (sqlly.app)。 代码和 SQL 片段: MIT. 许可详情