Skip to content
This repository was archived by the owner on Aug 17, 2026. It is now read-only.

Latest commit

 

History

History
162 lines (106 loc) · 9.36 KB

File metadata and controls

162 lines (106 loc) · 9.36 KB
sidebar_label Amazon RDS MySQL
description Step-by-step guide on how to set up Amazon RDS MySQL as a source for ClickPipes
slug /integrations/clickpipes/mysql/source/rds
title RDS MySQL source setup guide
doc_type guide
keywords
clickpipes
mysql
cdc
data ingestion
real-time sync
integration
support_level
core
category
clickpipes

import rds_backups from '@site/static/images/integrations/data-ingestion/clickpipes/mysql/source/rds/rds-backups.png'; import parameter_group_in_blade from '@site/static/images/integrations/data-ingestion/clickpipes/postgres/source/rds/parameter_group_in_blade.png'; import security_group_in_rds_mysql from '@site/static/images/integrations/data-ingestion/clickpipes/mysql/source/rds/security-group-in-rds-mysql.png'; import edit_inbound_rules from '@site/static/images/integrations/data-ingestion/clickpipes/postgres/source/rds/edit_inbound_rules.png'; import rds_config from '@site/static/images/integrations/data-ingestion/clickpipes/mysql/parameter_group/rds_config.png'; import binlog_format from '@site/static/images/integrations/data-ingestion/clickpipes/mysql/parameter_group/binlog_format.png'; import binlog_row_image from '@site/static/images/integrations/data-ingestion/clickpipes/mysql/parameter_group/binlog_row_image.png'; import binlog_row_metadata from '@site/static/images/integrations/data-ingestion/clickpipes/mysql/parameter_group/binlog_row_metadata.png'; import edit_button from '@site/static/images/integrations/data-ingestion/clickpipes/mysql/parameter_group/edit_button.png'; import enable_gtid from '@site/static/images/integrations/data-ingestion/clickpipes/mysql/enable_gtid.png'; import Image from '@theme/IdealImage';

This step-by-step guide shows you how to configure Amazon RDS MySQL to replicate data into ClickHouse Cloud using the MySQL ClickPipe. For common questions around MySQL CDC, see the MySQL FAQs page.

Enable binary log retention {#enable-binlog-retention-rds}

The binary log is a set of log files that contain information about data modifications made to an MySQL server instance, and binary log files are required for replication. To configure binary log retention in RDS MySQL, you must enable binary logging and increase the binlog retention interval.

1. Enable binary logging via automated backup {#enable-binlog-logging}

The automated backups feature determines whether binary logging is turned on or off for MySQL. Automated backups can be configured for your instance in the RDS Console by navigating to Modify > Additional configuration > Backup and selecting the Enable automated backups checkbox (if not selected already).

Enabling automated backups in RDS

We recommend setting the Backup retention period to a reasonably long value, depending on the replication use case.

2. Increase the binlog retention interval {#binlog-retention-interval}

:::warning If ClickPipes tries to resume replication and the required binlog files have been purged due to the configured binlog retention value, the ClickPipe will enter an errored state and a resync is required. :::

By default, Amazon RDS purges the binary log as soon as possible (i.e., lazy purging). We recommend increasing the binlog retention interval to at least 72 hours to ensure availability of binary log files for replication under failure scenarios. To set an interval for binary log retention (binlog retention hours), use the mysql.rds_set_configuration procedure:

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

If this configuration isn't set or is set to a low interval, it can lead to gaps in the binary logs, compromising ClickPipes' ability to resume replication.

Configure binlog settings {#binlog-settings}

The parameter group can be found when you click on your MySQL instance in the RDS Console, and then navigate to the Configuration tab.

:::tip If you have a MySQL cluster, the parameters below can be found in the DB cluster parameter group instead of the DB instance group. :::

Where to find parameter group in RDS


Click the parameter group link, which will take you to its dedicated page. You should see an **Edit** button in the top right.

Edit parameter group

The following parameters need to be set as follows:

  1. binlog_format to ROW.

Binlog format to ROW

  1. binlog_row_metadata to FULL

Binlog row metadata to FULL

  1. binlog_row_image to FULL

Binlog row image to FULL


Then, click on **Save Changes** in the top right corner. You may need to reboot your instance for the changes to take effect — a way of knowing this is if you see `Pending reboot` next to the parameter group link in the **Configuration** tab of the RDS instance.

Enable GTID Mode {#gtid-mode}

:::tip The MySQL ClickPipe also supports replication without GTID mode. However, enabling GTID mode is recommended for better performance and easier troubleshooting. :::

Global Transaction Identifiers (GTIDs) are unique IDs assigned to each committed transaction in MySQL. They simplify binlog replication and make troubleshooting more straightforward. We recommend enabling GTID mode, so that the MySQL ClickPipe can use GTID-based replication.

GTID-based replication is supported for Amazon RDS for MySQL versions 5.7, 8.0 and 8.4. To enable GTID mode for your Aurora MySQL instance, follow these steps:

  1. In the RDS Console, click on your MySQL instance.
  2. Click on the Configuration tab.
  3. Click on the parameter group link.
  4. Click on the Edit button in the top right corner.
  5. Set enforce_gtid_consistency to ON.
  6. Set gtid-mode to ON.
  7. Click on Save Changes in the top right corner.
  8. Reboot your instance for the changes to take effect.

GTID enabled


:::tip The MySQL ClickPipe also supports replication without GTID mode. However, enabling GTID mode is recommended for better performance and easier troubleshooting. :::

Configure a database user {#configure-database-user}

Connect to your RDS MySQL instance as an admin user and execute the following commands:

  1. Create a dedicated user for ClickPipes:

    CREATE USER 'clickpipes_user'@'host' IDENTIFIED BY 'some-password';
  2. Grant schema permissions. The following example shows permissions for the mysql database. Repeat these commands for each database and host you want to replicate:

    GRANT SELECT ON `mysql`.* TO 'clickpipes_user'@'host';
  3. Grant replication permissions to the user:

    GRANT REPLICATION CLIENT ON *.* TO 'clickpipes_user'@'%';
    GRANT REPLICATION SLAVE ON *.* TO 'clickpipes_user'@'%';

Using IAM authentication (optional) {#iam-authentication}

Instead of a password, you can authenticate the ClickPipes user via AWS IAM role-based access. Create the user as follows, then grant it the same schema and replication privileges shown above:

CREATE USER 'clickpipes_iam_user' IDENTIFIED WITH AWSAuthenticationPlugin AS 'RDS';

See AWS IAM DB authentication (RDS/Aurora) for the full steps to set up the IAM role and policy required for ClickPipes to authenticate this way.

Configure network access {#configure-network-access}

IP-based access control {#ip-based-access-control}

To restrict traffic to your Aurora MySQL instance, add the documented static NAT IPs to the Inbound rules of your RDS security group.

Where to find security group in RDS MySQL?

Edit inbound rules for the above security group

Private access via AWS PrivateLink {#private-access-via-aws-privatelink}

To connect to your RDS instance through a private network, you can use AWS PrivateLink. Follow the AWS PrivateLink setup guide for ClickPipes to set up the connection.

Next steps {#next-steps}

Now that your Amazon RDS MySQL instance is configured for binlog replication and securely connecting to ClickHouse Cloud, you can create your first MySQL ClickPipe. For common questions around MySQL CDC, see the MySQL FAQs page.