Common MySQL CDC errors and how to fix them▾

Learn

Common MySQL CDC errors and how to fix them

Fixes for common MySQL CDC errors: purged binary logs (1236), missing replication privileges (1227), wrong binlog format or row image, and missing primary keys.

“Could not find first log file name in binary log index file” (error 1236)

The binary log position the pipeline saved has been purged. Raise the retention (how long to keep binary logs) and re-copy the affected tables so nothing is missed.

“Access denied; you need (at least one of) the REPLICATION SLAVE privilege(s)” (error 1227)

The user can read tables but not the binary log. Grant both replication privileges:

GRANT REPLICATION SLAVE, REPLICATION CLIENT ON *.* TO 'quayen'@'%';

binlog_format is STATEMENT or MIXED

Statement-based logs record SQL, not the changed rows, so the values can't be read reliably. Set binlog_format = ROW (a parameter group on RDS, Aurora and Azure; a flag on Cloud SQL; my.cnf when self-hosted) and restart if your host requires it.

binlog_row_image is MINIMAL

Minimal row images leave out unchanged columns, so updates arrive incomplete. Set binlog_row_image = FULL.

Table has no primary key

Without a primary key there is no reliable way to match an update or delete to a row in BigQuery. Add one (an auto-increment id is fine) before replicating that table.

Timeouts connecting to MySQL

Almost always a firewall or security group. Allow the replication service's IP addresses on port 3306, or connect through an SSH bastion if MySQL is private.

Quayen's connection test checks all of these before you start and explains the fix for each one.