Amazon RDS MySQL
Prepare Amazon RDS for MySQL as the source for a VeloDB Cloud MySQL import. The documented MySQL-compatible source versions are 5.6, 5.7, and 8.0.x. These steps apply to an RDS for MySQL DB instance. On the instance, enable automated backups by setting the backup retention period to a positive number. RDS enables binary logging when automated backups are enabled.
1. Verify binary logging
Connect to the MySQL instance as a database administrator and run:
SHOW GLOBAL VARIABLES WHERE Variable_name IN ('log_bin', 'binlog_format', 'binlog_row_image');
Check for log_bin = ON, binlog_format = ROW, and binlog_row_image = FULL. Full row images let the job read the column values for updates and deletes. If all three settings match, continue to Create a replication user.
2. Configure the parameter group
Use a custom DB parameter group that matches the instance engine family. In the Amazon RDS console, choose Parameter groups, select the custom group, and edit binlog_format to ROW and binlog_row_image to FULL. If you created a new parameter group, associate it with the source instance under Databases > your instance > Modify.
For RDS for MySQL DB instances, binlog_format is dynamic. Editing the currently associated custom group does not require a reboot for this parameter. If you associate a different group, check its parameter status and schedule a reboot if AWS reports pending-reboot. Reconnect to the instance and repeat the checks above. See AWS binary logging settings.
3. Create a replication user
Use a dedicated account. Replace <source-password> with the account password, shop with the source database, and <client-host> with the host pattern MySQL sees for the warehouse connection. Use the same host value in all three statements.
CREATE USER 'cdc_reader'@'<client-host>' IDENTIFIED BY '<source-password>';
GRANT SELECT ON shop.* TO 'cdc_reader'@'<client-host>';
GRANT REPLICATION SLAVE, REPLICATION CLIENT ON *.* TO 'cdc_reader'@'<client-host>';
SHOW GRANTS FOR 'cdc_reader'@'<client-host>';
The job uses SELECT for the snapshot and the replication privileges to read binary log positions and events. Grant SELECT on each additional source database the account needs to read.
4. Set binary log retention
Choose a retention period long enough to cover the initial snapshot and expected interruptions. For example, run the following on the MySQL instance to retain logs for 72 hours and check the setting:
CALL mysql.rds_set_configuration('binlog retention hours', 72);
CALL mysql.rds_show_configuration;
Monitor source storage usage after increasing retention. If the source purges a log before the job consumes it, increasing retention protects future logs. Recovering the missing changes can require a new snapshot. See AWS binary log retention settings.
Connect the warehouse
Allow the warehouse to reach the source endpoint and port. If authentication fails, check the MySQL account's host pattern against the network route used by the warehouse. If the connection times out, check the route and the database security group. See Import from MySQL for private connectivity and the Console workflow.
To create the import in SQL, see MySQL CDC with Auto Table Creation or MySQL CDC with SQL Mapping.