Debezium MySQL 커넥터는 binlog 를 ROW 형식으로 읽는다[1]. binlog 가 꺼져 있거나 STATEMENT 형식이면 커넥터가 뜨지 않는다. MariaDB 도 같은 설정이지만 Debezium 3.x 에서는 전용 MariaDB 커넥터(io.debezium.connector.mariadb.MariaDbConnector)를 쓴다.
show variables like 'log_bin';
-- +---------------+-------+
-- | Variable_name | Value |
-- +---------------+-------+
-- | log_bin | ON |
-- +---------------+-------+
show variables like 'binlog_format';
-- +---------------+-------+
-- | Variable_name | Value |
-- +---------------+-------+
-- | binlog_format | ROW |
-- +---------------+-------+
show variables like 'binlog_row_image';
-- FULL 이어야 before 이미지가 온다
/etc/my.cnf 또는 /etc/my.cnf.d/server.cnf 의 [mysqld](MariaDB 는 [server] 도 된다) 섹션에 추가하고 재시작한다.
[mysqld]
# server-id 는 커넥터의 database.server.id 와 달라야 한다
server-id=1
log-bin=/var/log/mysql/bin.log
binlog_format=ROW
binlog_row_image=FULL
binlog_cache_size=2M
max_binlog_size=512M
# MySQL 8.0+ : 초 단위. 3일. (5.7 이하는 expire_logs_days=3)
binlog_expire_logs_seconds=259200
# KST 에러가 발생하는 경우
default-time-zone='+9:00'
MySQL 8.0 은 binlog 가 기본으로 켜져 있고 형식도 ROW 다. expire_logs_days 는 8.0 에서 deprecated 이고 8.4 에서 제거됐다.
커넥터가 쓸 계정에는 복제 권한이 필요하다[1:1].
CREATE USER 'debezium'@'%' IDENTIFIED BY '${DEBEZIUM_PASSWORD}';
GRANT SELECT, RELOAD, SHOW DATABASES, REPLICATION SLAVE, REPLICATION CLIENT ON *.* TO 'debezium'@'%';
FLUSH PRIVILEGES;
RELOAD 는 초기 스냅샷의 글로벌 읽기 락에, SHOW DATABASES 는 스키마 탐색에 쓴다. 스냅샷을 하지 않으면 RELOAD 는 뺄 수 있다.
Debezium connector for MySQL — Setting up MySQL — 2026-09-20 확인. https://debezium.io/documentation/reference/stable/connectors/mysql.html ↩︎ ↩︎