> ## Documentation Index
> Fetch the complete documentation index at: https://www.integrate.io/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Amazon RDS MySQL source for ELT & CDC

> How to configure Amazon RDS MySQL as a CDC source in Integrate.io ELT & CDC, including read-replica setup, user creation, and binary log configuration.

## Create Read-Replica (optional)

We recommend syncing data using a read-replica of your database to ensure sync doesn't affect your primary database instance. If you wish to sync against Primary, feel free to skip this step.Refer this [documentation](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_ReadRepl.html#USER_ReadRepl.Create) to create a read-replica.

## Create user

Create a sync user for Integrate.io by executing,

```sql theme={null}
CREATE USER 'flydata'@'%' IDENTIFIED BY '<your_password>';
```

Grant necessary privileges,

```sql theme={null}
GRANT SELECT, RELOAD, REPLICATION SLAVE, REPLICATION CLIENT, LOCK TABLES ON *.* TO 'flydata'@'%';
FLUSH PRIVILEGES;
```

## Enable binary logging

Create a [DB Parameter Group](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_WorkingWithParamGroups.html#USER_WorkingWithParamGroups.Creating) and set the following parameters:

| Parameter                     | Value                            |
| ----------------------------- | -------------------------------- |
| binlog\_format                | ROW                              |
| binlog\_row\_image            | FULL                             |
| binlog\_expire\_logs\_seconds | 604800  (Minimum 1 day or 86400) |

These are **recommended values for replication but not required**. Set the recommended values if you encounter timeouts.

| **Parameter**       | **Value** |
| ------------------- | --------- |
| net\_read\_timeout  | 3600      |
| net\_write\_timeout | 3600      |
| wait\_timeout       | 86400     |

Assign the newly created parameter group to your database and **reboot your database** instance.

Confirm your changes by checking the binlog status,

```sql theme={null}
SHOW GLOBAL VARIABLES LIKE 'log_bin';
```

## Increase binlog retention

To increase the binlog retention of the DB cluster, use the mysql\_rds\_set\_configuration procedure. You can run the following command and sample parameters on the writer instance to retain the binlog files for 7 days (Minimum 1 day)

```sql theme={null}
CALL mysql.rds_set_configuration('binlog retention hours', 168);
```
