1982
MariaDBERRORCommonReplicationHIGH confidence

Fatal error reading binary log on master

Production Risk

Critical — replication stops; replica falls behind and may serve stale data.

What this means

The replica encountered a fatal error while reading the binary log from the source server, causing replication to stop. This usually means the binary log file is corrupted, missing, or the log position is invalid.

Why it happens
  1. 1Binary log file on the source is corrupted or truncated.
  2. 2Specified MASTER_LOG_POS points to an invalid position.
  3. 3Source server was restarted and binary logs were purged.
  4. 4Network interruption causing partial binlog event transmission.
How to reproduce
trigger — this will error
trigger — this will error
CHANGE MASTER TO MASTER_LOG_FILE='mysql-bin.000999', MASTER_LOG_POS=9999999;

expected output

ERROR 1982 (HY000): Fatal error reading the binary log while attempting to dump from master.

Fix 1

Identify and set a valid binary log position on the source

Identify and set a valid binary log position on the source
SHOW MASTER STATUS; -- on source
CHANGE MASTER TO MASTER_LOG_FILE='mysql-bin.000001', MASTER_LOG_POS=4; -- on replica

Why this works

A valid starting position allows the replica to resume reading events.

Fix 2

Re-initialise replication from a fresh backup

Re-initialise replication from a fresh backup
STOP SLAVE; RESET SLAVE ALL;
-- Restore backup, then CHANGE MASTER TO ...

Why this works

If the binlog position is irrecoverable, re-seeding from backup is the safest option.

What not to do

Sources
Official documentation ↗

MySQL 8.0 — 1982 ER_MASTER_FATAL_ERROR_READING_BINLOG

Content generated with AI assistance and reviewed for accuracy. Found an error? hello@errcodes.dev

← All MariaDB errors