Skip to content

Instantly share code, notes, and snippets.

@samklr
Last active December 20, 2018 14:47
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save samklr/95ee6d61e66403f9d6f14089d7924aed to your computer and use it in GitHub Desktop.
Save samklr/95ee6d61e66403f9d6f14089d7924aed to your computer and use it in GitHub Desktop.
Enabling RDS MySQL for Change Data Capture

Do this before you add any data to your instance.

For RDS : Create a Parameter Group with the following parameters changed :
- Set binlog_format = ROW
- Set binlog_row_image = FULL
- Set binlog_rows_query_log_events = ON (1)
- (Optional) Set max_allowed_packet = Max (Increase ...)

Once the instance is created with the above parameter group, you'll need to change retention time of the binlog
because AWS flushes the binary logs instantaneously.
To change that log into mysql :

mysql > call mysql.rds_set_configuration('binlog retention hours', 168);

Check that the value has changed :
mysql > call mysql.rds_show_configuration;

Now you should be able to read the event stream of your DB.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment