FULL AI ANALYSIS

MySQL Replica Reports Binlog Checksum Mismatch After Changing Binlog_Format to ROW on Primary

Generated Oct 3, 2026, 12:35:03 AM

Analysis summary

Checksum mismatch and truncated relay logs typically arise from network interruptions while fetching binlog events, differences in binlog checksum configurations between primary and replica at the time of fetch, or pre-existing relay logs left over from prior configuration changes. Because GTID is used, the safest recovery is to re-initialize the replica’s relay state from a consistent snapshot, but smaller fixes may be possible if corruption is limited to recent relay files.

Possible causes

Partial relay log writes on the replica due to brief TCP resets or I/O issues while fetching binlog events, causing checksum failures when SQL thread reads them.

90%

Mismatch of binlog_checksum setting between primary and replica while relay logs were generated (replica created relay logs without checksum or with different CRC settings).

85%

Residual older relay logs from before config change causing replica to attempt to apply mixed-format or mismatched-checksum files.

70%

Disk or filesystem corruption on replica causing truncated relay logs.

25%

Suggested fixes

1

Diagnostic step 1

Record current GTID_EXECUTED and GTID_PURGED on both servers. Do not alter GTID sets yet—export them for reference.

2

Diagnostic step 2

On the replica, move existing relay logs to a safe backup directory (stop replication first), preserving them for forensic analysis. This is reversible by moving them back.

3

Diagnostic step 3

Ensure replica my.cnf binlog_checksum matches primary (set to CRC32) and restart mysqld if necessary—document change and restart impact on local writes.

4

Diagnostic step 4

Attempt to resume replication by issuing CHANGE MASTER TO MASTER_AUTO_POSITION = 1 and START SLAVE after clearing relay logs; monitor error output. If errors persist, perform a fresh logical or physical snapshot (mysqldump --single-transaction with GTIDs or xtrabackup) and reinitialize replica from a consistent snapshot.

5

Diagnostic step 5

If disk errors suspected, run filesystem checks in read-only safe mode and inspect SMART on replica disk. Escalate to DBA team to coordinate full re-sync during a maintenance window if a full rebase is required.