This page describes how to configure change data capture (CDC) to stream data from an Amazon Aurora MySQL database to a supported destination, such as BigQuery or Cloud Storage.
Create a parameter group
Launch your Amazon RDS Dashboard.
In the Navigation Drawer, click Parameter Groups.
Click Create Parameter Group. The Create Parameter Group page appears.
Use the following table to populate the fields of this page:
Field Description Parameter group family Select the family that matches your database. Type Select DB Cluster Parameter Group. Group name Provide a name for the parameter group. Description Provide a description for the parameter group. Click Create.
Select the checkbox to the left of your newly created parameter group.
Under Parameter group actions, click Edit.
Set the following parameter values:
For GTID-based replication:
Parameter Value binlog_format ROWlog_bin_use_v1_row_events 1read_only 0net_read_timeout 3600net_write_timeout 3600wait_timeout 86400expire-logs-days 7binlog_row_image FULLmax_allowed_packet 1G(recommended value)log-replica-updates 1enforce-gtid-consistency ONgtid_mode
You can only set this parameter toONONafter you setenforce-gtid-consistencytoON. In general,gtid_modecan have the following values:OFFOFF_PERMISSIVEON_PERMISSIVEON
gtid_modeparameter one step at a time. For example, if the current mode is set toOFF, do the following:- Change the setting to
OFF_PERMISSIVE. - Change the setting to
ON_PERMISSIVE. - Change the setting to
ON.
For binlog-based replication:
Parameter Value binlog_format ROW
Click Save Changes.
Assign the parameter group to the database instance
Launch your Amazon RDS Dashboard.
In the Navigation Drawer, click Databases, and then select your database instance.
From the Instance Actions menu, select Modify. The Modify DB Instance dialog appears.
In the Additional configuration section, select the database cluster parameter group that you created.
Set the Backup retention period to 7 days.
Click Continue.
In the Scheduling of Modifications pane, select the Apply immediately option.
Set the binary log retention period
Enter the following MySQL command:
call mysql.rds_set_configuration('binlog retention hours', 168);
Restart your MySQL server so that the changes you made can take effect.
Create a Datastream user
Create a Datastream user:
CREATE USER 'datastream'@'%' IDENTIFIED BY 'YOUR_PASSWORD';
Grant the following privileges to them:
GRANT REPLICATION SLAVE, SELECT, REPLICATION CLIENT ON *.* TO 'datastream'@'%'; GRANT EXECUTE ON PROCEDURE mysql.rds_show_configuration TO 'datastream'@'%'; FLUSH PRIVILEGES;
What's next
- Learn more about how Datastream works with MySQL sources.