MySQL / MariaDB
CDC source setup for MySQL and MariaDB
Prerequisites
-- Verify binlog is enabled and using ROW format
SHOW VARIABLES LIKE 'log_bin'; -- Must be ON
SHOW VARIABLES LIKE 'binlog_format'; -- Must be ROW
SHOW VARIABLES LIKE 'binlog_row_image'; -- Should be FULLGRANT REPLICATION SLAVE, REPLICATION CLIENT ON *.* TO 'sling_user'@'%';
GRANT SELECT ON my_database.* TO 'sling_user'@'%';Quick Start
# Source MySQL
sling conns set MY_MYSQL type=mysql host=mysql.example.com user=sling_user password=secret database=my_database
# Target PostgreSQL
sling conns set MY_POSTGRES type=postgres host=pg.example.com user=postgres password=secret database=analytics
# State store (required for CDC)
export SLING_STATE='MY_POSTGRES/sling_state'Examples
Large Tables with Custom Chunk Size
Time-Bounded Snapshots for Very Large Tables
High-Throughput Workloads
Soft Deletes
Mixed Streams with Per-Stream Overrides
Replay / Backfill from a Point in Time
Replay Formats
Binlog Retention
Troubleshooting
"CDC not supported for <type>"
Initial snapshot keeps restarting
Missing changes after snapshot
"could not resolve replay_from position"
Binlog purged before CDC could read
Last updated
Was this helpful?