GuidesData Sync

Example - Sync from MySQL to Tacnode

Preparation

Network setup refers to Data Synchronization Network Connection

Permissions

Only full synchronization jobs are included. The following permissions have been granted. The ${user} is recognized as the operator of the synchronization job, and the ${password} refers to the user's password.

mysql> GRANT SELECT, SHOW DATABASES ON *.* TO '${user}' IDENTIFIED BY '${password}';
       FLUSH PRIVILEGES;

If incremental synchronization jobs are included, ensure these permissions are granted.

mysql> GRANT REPLICATION SLAVE, REPLICATION CLIENT ON *.* TO '${user}' IDENTIFIED BY '${password}';
       FLUSH PRIVILEGES;

Incremental synchronization jobs enable binlog

  1. Verify if binlog is enabled
mysql> select @@log_bin; -- Check if binlog is enabled, 0 means disabled, 1 means enabled
mysql> show variables like 'server_id';
mysql> show variables like 'binlog%';

Please verify that the following parameters are accurate:

  • server_id is not empty
  • log_bin is set to 1
  • binlog_format is set to ROW
  • binlog_row_image is set to FULL
  1. If any parameters do not match the above:
  • If you have set up your own MySQL service, update mysqld.cnf and restart the MySQL service.
  • For RDS services provided by cloud vendors, typically, you can restart them after saving changes in the console.

Data Source Configuration

To set up the MySQL data source, it must be configured using these connection properties:

  • Host: Address of the MySQL service
  • Port: Typically 3306, this is the port for MySQL services
  • Username: The user with the necessary permissions
  • Password: The password associated with the specified username

Default Node Mapping

The default mapping rules for mapping nodes are outlined below:

concat(SOURCE_DATABASE, '.', 'public', '.', SOURCE_OBJECT)

Meaning: In Tacnode, MySQL tables like d.t (with d being the database name and t representing the table name) correspond to d.public.t (where public is the schema).

Default Type Mapping

MySQLTacnode
TINYINTINT2
SMALLINTINT2
MEDIUMINTINT4
INTINT4
BIGINTINT8
TINYINT UNSIGNEDINT2
SMALLINT UNSIGNEDINT4
MEDIUMINT UNSIGNEDINT4
INT UNSIGNEDINT8
BIGINT UNSIGNEDNUMERIC
NUMERICNUMERIC
DECIMAL UNSIGNEDNUMERIC
FLOATFLOAT4
FLOAT UNSIGNEDFLOAT4
DOUBLEFLOAT8
DOUBLE UNSIGNEDFLOAT8
CHARCHAR
VARCHARVARCHAR
TINYTEXTTEXT
TEXTTEXT
MEDIUMTEXTTEXT
LONGTEXTTEXT
BINARYBYTEA
VARBINARYBYTEA
TINYBLOBBYTEA
BLOBBYTEA
MEDIUMBLOBBYTEA
LONGBLOBBYTEA
ENUMTEXT
SETTEXT
DATEDATE
DATETIMETIMESTAMP
TIMESTAMPTIMESTAMPTZ
TIMETIME
YEARINT2
JSONJSONB

On this page