Amazon RDS MySQL

Last updated on Mar 13, 2025

Amazon Relational Database Service (RDS) allows you to deploy scalable MySQL servers in minutes with cost-efficient and resizable hardware capacity.

You can ingest data from your Amazon RDS MySQL database using Hevo Pipelines and replicate it to a Destination of your choice. Hevo recommends connecting to a read-replica of your master MySQL database, however, this is not mandatory. A read-replica reflects the changes to your master database in near real-time, and can reduce the load on the master database by serving all “read” requests. The Role attribute of the instance identifies its type.


Prerequisites


Perform the following steps to configure your Amazon RDS MySQL Source:

Step 1
Create a Read Replica (Optional)


Step 2
Set up MySQL Binary Logs for Replication

This step is required only for Pipelines with BinLog mode.

A binary log is a collection of log files that records information about data modifications and data object modifications made on a MySQL server instance. Typically binary logs are used for data replication and data recovery.

In order for the binary log to record the data modifications, automatic backups must be enabled with a duration of at least 1 day.

Note: To use BinLog replication, your Amazon RDS MySQL database must be running on MySQL version 5.6 or higher.

To enable binary logging, follow these steps:

1. Configure the parameter group

  1. Open the Amazon RDS console.

  2. In the left navigation pane, click Databases (or Instances if you are using an older version).

  3. In the Databases section on the right, select the DB instance that you want to connect.

    Select DB Instance

  4. Click the Configuration tab, and then click the link text under DB instance parameter group.

    Open Parameter Group Settings

  5. Click Edit.

    Click Edit

  6. Update the values of the parameters as follows:

    Enter Parameter Value

    Parameter Name Value
    binlog_format ROW
    binlog_row_image full
    log_slave_updates 1

    Note: The log_slave_updates setting is required only if you are connecting to a read replica. When it is set to 1, the replica logs any updates received from the main database, maintaining a record of those changes in its log.

  7. Click Save changes.

  8. Reboot the database instance that you are using to connect to Hevo, to apply the above changes.

    To do this:

    1. In the left navigation pane, under Dashboard, select Databases.

    2. In the Databases section on the right, select the DB identifier of the MySQL instance you are replicating.

    3. In the Actions drop-down, click Reboot.

      Reboot Instance

    4. On the Reboot DB Instance page, click Confirm to reboot your DB instance.

      Click Confirm

The replication reference guide on MySQL’s documentation portal provides a complete reference of the options available for replication and binary logging.

2. Enable Automatic Backups

  1. In the Amazon RDS console, in the left navigation pane, click Databases (or Instances if you are using an older version).

  2. In the Databases section on the right, select the instance for which you want to enable automatic backups, and then click Modify.

    Click Modify

  3. On the Modify DB Instance page, scroll down to the Backup section.

  4. Select the Enable automated backups check box.

  5. Set the Backup retention period to any value greater than or equal to 1 day. A backup retention period of at least 3 days is recommended.

    Enable Automatic Backups

  6. Click Continue.

  7. Under the Schedule modifications panel, select Apply immediately, and then click Modify DB instance.

    Modify instance

3. Configure the BinLog retention period

  1. Log in to your Amazon RDS MySQL database instance with ADMIN privileges.

  2. Run the following command to view the current BinLog retention period (in hours):

    call mysql.rds_show_configuration;
    
  3. If the BinLog retention period is less than 72 hours, run the following command to set it to at least 72 hours (three days).

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

Step 3
Whitelist Hevo’s IP Addresses

You need to whitelist the Hevo IP address for your region to enable Hevo to connect to your Amazon RDS MySQL database.

To do this:

  1. Open the Amazon RDS console.

  2. In the left navigation pane, click Databases (or Instances if you are using an older version).

  3. In the Databases section on the right, click the DB identifier of the Amazon RDS MySQL instance to configure a security group.

    Click DB Instance

    Note: The instance does not necessarily have to be a replica as long as it whitelists the region’s IP addresses.

  4. In the Connectivity & security tab:

    Open Security Group Panel

    1. Note the region where your account is set up, using the Hevo App URL also. For example, the URL for the US region is https://us.hevodata.com/.

    2. Click the link text under Security, VPC security groups to open the Security Groups panel.

  5. On the Security Groups page, select the check box for your Security group ID, and from the Actions drop-down, click Edit inbound rules.

    Edit Inbound Rules

  6. On the Edit inbound rules page:

    1. Click Add rule.

    2. In the Port range column, enter the port of your Amazon RDS MySQL instance. For example, 3306.

    3. In the Source column, select Custom from the drop-down and enter Hevo’s IP addresses for your region.

    4. Click Save rules.

    Add Rules


Step 4
Create a Database User and Grant Privileges

1. Create a database user (Optional)

2. Grant privileges to the user

The database user specified in the Hevo Pipeline must have the following global privileges:

  • SELECT

  • SUPER or (REPLICATION CLIENT and REPLICATION SLAVE)

Perform the following steps to set up these privileges:

  1. Connect to your Amazon RDS MySQL database as a root user with an SQL client tool, such as MySQL workbench.

  2. Grant SELECT and REPLICATION privileges to the user:

    GRANT SELECT, REPLICATION CLIENT, REPLICATION SLAVE ON *.* TO <username>@'%';
    
  3. Allow Hevo to access your database:

    GRANT SELECT ON <database-name>.* TO <username>;
    
  4. Grant privileges to the database user to read BinLog settings if ingestion mode is Binlog:

    GRANT EXECUTE ON PROCEDURE mysql.rds_show_configuration TO '<username>'@'<hostname>';
    

Note: Replace the placeholder values in the commands above with your own. For example, <username> with hevo.


Step 5
Retrieve the Hostname and Port Number (Optional)


Step 6
Specify Amazon RDS MySQL Connection Settings

Perform the following steps to configure Amazon RDS MySQL as a Source in Hevo:

  1. Click PIPELINES in the Navigation Bar.

  2. Click + CREATE PIPELINE in the Pipelines List View.

  3. On the Select Source Type page, select Amazon RDS MySQL.

  4. On the Configure your Amazon RDS MySQL Source page, specify the following:

    RDS MySQL settings

    • Pipeline Name: A unique name for your Pipeline, not exceeding 255 characters.

    • Database Host: The MySQL host’s IP address or DNS.

      The following table lists a few examples of MySQL hosts:

      Variant Host
      Amazon RDS MySQL mysql-rds-1.xxxxx.rds.amazonaws.com
      Azure MySQL mysql.database.windows.net
      Generic MySQL 10.123.10.001 or mysql-replica.westeros.inc
      Google Cloud MySQL 35.220.150.0

      Note: For URL-based hostnames, exclude the http:// or https:// part. For example, if the hostname URL is http://mysql-replica.westeros.inc, enter mysql-replica.westeros.inc.

    • Database Port: The port on which your Amazon RDS MySQL server listens for connections. Default value: 3306.

    • Database User: The authenticated user who has the permissions to read tables in your database.

    • Database Password: The password for the database user.

    • Select an Ingestion Mode: The desired mode by which you want to ingest data from the Source. You can expand this section by clicking SEE MORE to view the list of ingestion modes to choose from. Default value: BinLog. The available ingestion modes are BinLog, Table, and Custom SQL.

      Ingestion Modes

      Depending on the ingestion mode you select, you must configure the objects to be replicated. Refer to section, Object and Query Mode Settings for the steps to do this.

      Note: For Custom SQL ingestion mode, all Events loaded to the Destination are billable.

    • Database Name: The database you want to load data from if the Pipeline mode is Table or Custom SQL.

    • Connection Settings

      • Connect through SSH: Enable this option to connect to Hevo using an SSH tunnel, instead of directly connecting your MySQL database host to Hevo. This provides an additional level of security to your database by not exposing your MySQL setup to the public. Read Connecting Through SSH.

        If this option is disabled, you must whitelist Hevo’s IP addresses. Refer to the content for your MySQL variant for steps to do this.

      • Use SSL: Enable it to use SSL encrypted connection. To enable this, specify the following:

        • CA File: The file containing the SSL server certificate authority (CA).

          • Load all CA Certificates: If selected, Hevo loads all CA certificates (up to 50) from the uploaded CA file, else it loads only the first certificate.

            Note: Select this check box if you have more than one certificate in your CA file.

        • Client Certificate: The client public key certificate file.

        • Client Key: The client private key file.

    • Advanced Settings

      • Load All Databases: This option applies to log-based Pipelines. If enabled, Hevo loads the data from all databases on the selected host and fetches the schema for all the tables within these databases. If disabled, specify a comma-separated list of database names from which you want to load data. Hevo fetches the schema of tables only from the specified databases.

        Note:

        • Hevo cannot access or read any tables that are not part of databases active in the Pipeline.

        • Hevo requires read access to the specified databases.

        • If access is restricted to certain databases, Hevo fetches the schema only of tables within those databases. For example, if Load All Databases option is enabled, but Hevo has permission to access only one database, it cannot fetch schemas from the others. This may lead to issues when the data required for queries or Transformations resides outside the accessible database. To avoid such cases, ensure that Hevo has permission to access all active databases.

      • Load Historical Data: Applicable for Pipelines with BinLog mode. If this option is enabled, the entire table data is fetched during the first run of the Pipeline. If disabled, Hevo loads only the data that was written in your database after the time of creation of the Pipeline.

      • Merge Tables: Applicable for Pipelines with BinLog mode. If this option is enabled, Hevo merges tables with the same name from different databases while loading the data to the warehouse. Hevo loads the Database Name field with each record. If disabled, the database name is prefixed to each table name. Read How does the Merge Tables feature work?.

      • Include New Tables in the Pipeline: Applicable for all ingestion modes except Custom SQL.

        If enabled, Hevo automatically ingests data from tables created in the Source after the Pipeline has been built. These may include completely new tables or previously deleted tables that have been re-created in the Source.

        If disabled, new and re-created tables are not ingested automatically. They are added in SKIPPED state in the objects list, on the Pipeline Overview page. You can update their status to INCLUDED to ingest data. You can include these objects post-Pipeline creation to ingest data.

        You can change this setting later.

  5. Click TEST CONNECTION. This button is enabled once you specify all the mandatory fields. Hevo’s underlying connectivity checker validates the connection settings you provide.

  6. Click TEST & CONTINUE to proceed for setting up the Destination. This button is enabled once you specify all the mandatory fields.


Object and Query Mode Settings

Once you have specified the Source connection settings in Step 6 above, do one of the following:

  • For Pipelines with Table or BinLog mode:

    1. On the Select Objects page, select the objects you want to replicate and click CONTINUE.

      Object Selection

      Note: Each object represents a table in your database.

    2. On the Configure Objects page, specify the query mode you want to use for each selected object.

      Query-Mode Selection

  • For Pipelines with Custom SQL mode:

    1. On the Provide Query Settings page, enter the custom SQL query to fetch data from the Source.

    2. In the Query Mode drop-down, select the query mode, and click CONTINUE.

      Custom SQL


Data Replication

For Teams Created Ingestion Mode Default Ingestion Frequency Minimum Ingestion Frequency Maximum Ingestion Frequency Custom Frequency Range (in Hrs)
Before Release 2.21 Table 15 Mins 15 Mins 24 Hrs 1-24
  Log-based 5 Mins 5 Mins 1 Hr NA
After Release 2.21 Table 6 Hrs 30 Mins 24 Hrs 1-24
  Log-based 30 Mins 30 Mins 12 Hrs 1-24

Note: The custom frequency must be set in hours as an integer value. For example, 1, 2, or 3 but not 1.5 or 1.75.

  • Historical Data: In the first run of the Pipeline, Hevo ingests all available data for the selected objects from your Source database.

  • Incremental Data: Once the historical load is complete, data is ingested as per the ingestion frequency.


Additional Information

Read the detailed Hevo documentation for the following related topics:


Source Considerations

  • MySQL does not generate log entries for cascading deletes. So, Hevo cannot capture these deletes for log-based Pipelines.

Limitations

  • Hevo only fetches tables from the MySQL database. It does not fetch other entities such as functions, stored procedures, views, and triggers.

    To fetch views, you can create individual Pipelines in Custom SQL mode. However, some limitations may arise based on the type of data synchronization, the query mode, or the number of Events. Contact Hevo Support for more details.

  • During the historical load, Hevo reads table definitions directly from the MySQL database schema, whereas for incremental updates, Hevo reads from the BinLog. As a result, certain fields, such as nested JSON, are parsed differently during historical and incremental loads. In the Destination tables, nested JSON fields are parsed as a struct or JSON during historical loads, but as a string during incremental loads. This leads to a data type mismatch between the Source and Destination data, causing Events to be sidelined.

    To ensure JSON fields are parsed correctly during the historical load, you can apply transformations to every table containing nested JSON fields. Contact Hevo Support for more details.

  • Hevo Pipelines may fail to process transactions in the BinLog if the size of the transaction exceeds 4GB. This problem is due to a MySQL bug that affects the library used by Hevo to stream Events, resulting in ingestion failures. In such cases, Hevo attempts to restart the ingestion process from the beginning of the transaction, skipping already processed Events. If the problem of transaction processing persists and the BinLog remains stuck, contact Hevo Support for assistance.

  • Hevo does not load an Event into the Destination table if its size exceeds 128 MB, which may lead to discrepancies between your Source and Destination data. To avoid such a scenario, ensure that each row in your Source objects contains less than 100 MB of data.


See Also


Revision History

Tell us what went wrong