v2.0
- About MDB
- Installation
- Upgrade
- Concepts
- User Interface
- Source Requirements
- Target Database Requirements
- Target Kafka Requirements
- Usage Restriction
- Frequently Exceptions
- Release Note
MySQL as a Source Database
Supported Version
5.7, 8.0.x (not support MariaDB)
Database Configuration
Binlog Configuration
vi /etc/my.cnf
# add the following content to the end of the file
server_id=2
log_bin = mysql-bin
binlog_format = ROW
# Restarting the mysql Service
systemctl restart mysqld
Binlog Check
SHOW VARIABLES WHERE VARIABLE_NAME IN ('log_bin','binlog_format');
-- 期望结果:log_bin: ON, binlog_format: ROW
Set User Permission
Create the mdb_user user,Grant the required permissions to the user:
CREATE USER 'mdb_user'@'localhost' IDENTIFIED BY 'Enmo@123';
GRANT SELECT, RELOAD, SHOW DATABASES, REPLICATION SLAVE, REPLICATION CLIENT, SHOW VIEW ON *.* TO 'mdb_user' IDENTIFIED BY 'Enmo@123';
FLUSH PRIVILEGES;
Enable Heartbeat Configuration
Heartbeat messages are useful for monitoring whether the connector is receiving change events from the database. Heartbeat messages might help decrease the number of change events that need to be re-sent when a connector restarts.
To enable the heartbeat configuration, see Channel-related Advanced Parameters. You need to set heartbeatIntervalMs
to a positive integer, and run the following command on the source node.
Note: The following is only an example. The table name heartbeat
needs to be consistent with the heartbeatTableName
value.
CREATE TABLE heartbeat (`ts` timestamp ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
INSERT INTO heartbeat (ts) VALUES (NOW());
Character Set Mapping
Source Database | Target Database | Character Set of the Source Database | Character Set of the Target Database |
---|---|---|---|
MySQL | MogDB | BIG5 | BIG5 |
MySQL | MogDB | LATIN1 | LATIN1 |
MySQL | MogDB | LATIN2 | LATIN2 |
MySQL | MogDB | SJIS | SJIS |
MySQL | MogDB | EUCKR | EUC_KR |
MySQL | MogDB | KOI8U | KOI8U |
MySQL | MogDB | GBK | GBK |
MySQL | MogDB | LATIN5 | LATIN5 |
MySQL | MogDB | UTF8 | UTF8 |
MySQL | MogDB | LATIN7 | LATIN7 |
MySQL | MogDB | UTF8MB4 | UTF8 |
MySQL | MogDB | GB2312 | GB18030 |