Skip to main content

Amazon Aurora MySQL

Prepare Amazon Aurora 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. Use the writer endpoint of the Aurora MySQL cluster for replication and for the SQL checks below. Enable binary logging on the source cluster before creating the import job.

1. Verify binary logging​

Connect to the Aurora writer 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​

In the Amazon RDS console, choose Parameter groups and edit a custom DB cluster parameter group for the Aurora MySQL engine family. Set binlog_format to ROW and binlog_row_image to FULL. If you created a new group, open the source cluster under Databases, choose Modify, and select the group under DB cluster parameter group.

Aurora MySQL treats binlog_format as static. Schedule the reboot required for the change, taking the writer interruption into account. Reconnect to the writer 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 Aurora writer 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.

Ask AI