Overview
By enabling Change Data Capture (CDC) for the data source, you can implement real-time data synchronization and DDL synchronization of data tables.
This article describes how to enable binlog-based CDC for MySQL databases. FineDataLink supports row-based logging.
Procedure
Confirming the Database Version
Confirm that Data Pipeline supports the version of the currently used database.
Currently, only MySQL 5.5 and above non-read-only databases are supported.
Enabling the Binlog for the Database
You need to enable the binlog for the database in advance since the real-time synchronization task reads the MySQL database data via the binlog.

Enter the /etc directory and open the my.cnf file, as shown in the following figure.
Add the following content to the my.cnf file.

1. The operation is performed in a Linux environment. Modify the my.ini file if MySQL is deployed in a Windows environment.
2. You can set server_id to any number.
server_id=2
log_bin=mysql-bin
binlog_format=ROW
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
Save the file and restart MySQL for the configuration to take effect.
Enter the following command to confirm that the value of log_bin is on, which indicates that the log has been enabled, as shown in the following figure.
show variables like 'log_%'
Enter the following command to confirm that the values of binlog_row_image and binlog_format are FULL and ROW respectively, as shown in the following figure.
show variables like 'binlog_%'
Granting the Specified Account Replication Privileges
Generally, you need to grant the user account REPLICATION SLAVE and REPLICATION CLIENT privileges to allow replication.
The REPLICATION CLIENT privilege cannot be used to set up a replica. It only allows users to use the following commands.
SHOW SLAVE STATUS
SHOW MASTER STATUS
1. Check the user privileges.
You can use the following command to check the privileges granted to the user.
show grants for Username
If there are no REPLICATION CLIENT or REPLICATION SLAVE privileges in the return value, assign the user the replication privileges.
2. Grant privileges using the following commands, as shown in the following figure.
grant replication client on *.* to Username
grant replication slave on *.* to Username
Use the following command to confirm the return value contains the following privileges, which indicates that the replication privileges are granted successfully, as shown in the following figure.
show grants for Username
Subsequent Operations
Configure the database, and then you can set up the data source.
Connect FineDataLink to the source and target databases before setting up a pipeline task for real-time synchronization. This allows you to set the data source during the task configuration by selecting its name. For details, see Data Source Creation and Management.
Complete the pipeline task setup then. For details, see Pipeline Task Configuration.