[[["Fácil de entender","easyToUnderstand","thumb-up"],["Meu problema foi resolvido","solvedMyProblem","thumb-up"],["Outro","otherUp","thumb-up"]],[["Difícil de entender","hardToUnderstand","thumb-down"],["Informações incorretas ou exemplo de código","incorrectInformationOrSampleCode","thumb-down"],["Não contém as informações/amostras de que eu preciso","missingTheInformationSamplesINeed","thumb-down"],["Problema na tradução","translationIssue","thumb-down"],["Outro","otherDown","thumb-down"]],["Última atualização 2025-08-12 UTC."],[[["\u003cp\u003eThis guide explains how to configure Change Data Capture (CDC) for an Amazon RDS for MySQL database, involving creating a parameter group and a read replica.\u003c/p\u003e\n"],["\u003cp\u003eConfiguring the parameter group requires setting specific values for binlog format, timeouts, and other parameters, with options for both binlog-based and GTID-based replication, and ensuring the correct settings are applied.\u003c/p\u003e\n"],["\u003cp\u003eCreating and using a read replica is highly recommended to reduce the replication load on the main database, and after its creation, the read replica's parameter group and backup retention period should be configured.\u003c/p\u003e\n"],["\u003cp\u003eAfter assigning the parameter group to the database instance and verifying its status, a reboot is required for the changes to take effect, with a status update to \u003ccode\u003ein-sync\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eThe process also involves setting the binary log retention period to a minimum of 7 days (168 hours) and creating a Datastream user with the necessary privileges for replication and data access.\u003c/p\u003e\n"]]],[],null,["# Configure an Amazon RDS MySQL database\n\nThe following sections cover how to configure CDC for an Amazon RDS for MySQL\ndatabase.\n\nCreate a parameter group\n------------------------\n\n1. Launch your Amazon RDS Dashboard.\n\n2. In the **Navigation Drawer** , click **Parameter Groups**.\n\n3. Click **Create Parameter Group** . The **Create Parameter Group** page appears.\n\n4. Select the database family that matches your database, provide a name and\n description for the parameter group.\n\n5. Click **Create**.\n\n6. Select the checkbox to the left of your newly created parameter group.\n\n7. Under **Parameter group actions** , click **Edit**.\n\n8. Use the following table to set the parameters for your group.\n\n - For **binlog-based** replication:\n\n - For **GTID-based** replication:\n\n9. Click **Save Changes**.\n\nCreate a read replica\n---------------------\n\n\u003cbr /\u003e\n\n| Although this is officially an optional step, we\n| highly recommend using a read replica because it will lessen the load of\n| replication on your MySQL database significantly.\n|\n| If you choose to replicate directly from the main server, then follow the\n| instructions in [Configure the read\n| replica (or source database)](#configure-the-read-replica-rds).\n\n\u003cbr /\u003e\n\n1. Launch your Amazon RDS Dashboard.\n\n2. In the **Navigation Drawer** , click **Databases**.\n\n3. Select the main database instance to which you want Datastream to\n connect.\n\n4. Expand the **Actions** button, and then click **Create read replica**.\n\n5. Configure the read replica, as necessary.\n\n6. Click **Create read replica**.\n\nConfigure the read replica (or source database)\n-----------------------------------------------\n\n1. Launch your Amazon RDS Dashboard.\n\n2. In the **Navigation Drawer** , click **Databases**.\n\n3. Select the read replica that you [created](#create-a-read-replica-rds), and\n then click **Modify**.\n\n4. Go to the **Additional configuration** section.\n\n5. Select the parameter group that you [created](/datastream/docs/create-a-parameter-group-rds).\n\n6. Set the **Backup retention period** to **7 days**.\n\n7. Click **Continue**.\n\n8. Under **Scheduling of modifications** , select **Apply immediately**.\n\n | Because you modified your read replica, you must wait until the changes to your parameter group are applied before proceeding.\n\nVerify that the parameter group is assigned to the database instance\n--------------------------------------------------------------------\n\n1. Launch your Amazon RDS Dashboard.\n\n2. In the **Navigation Drawer** , click **Databases**, and then select your\n database instance.\n\n3. Click the **Configurations** tab.\n\n4. Verify that you see the parameter group that you [created](#create-a-parameter-group-rds),\n and that its status is **pending-reboot**.\n\n5. Reboot your database instance to complete the configuration. To reboot the\n instance:\n\n 1. In the **Navigation Drawer** , click **Instances**.\n 2. Select your database instance.\n 3. From the **Instance Actions** menu, select **Reboot**.\n\n | After you reboot your database instance, its status changes to \\*\\*in-sync\\*\\*.\n\nSet the binary log retention period\n-----------------------------------\n\n1. Enter the following MySQL command:\n\n ```sql\n call mysql.rds_set_configuration('binlog retention hours', 168);\n ```\n | You're entering this command because you want to ensure proper replication by configuring your system to retain binary logs for a minimum of 7 days (or 168 hours).\n2. Restart your MySQL server so that the changes you made can take effect.\n\nCreate a Datastream user\n------------------------\n\n1. Create a Datastream user:\n\n ```sql\n CREATE USER 'datastream'@'%' IDENTIFIED BY '\u003cvar translate=\"no\"\u003eYOUR_PASSWORD\u003c/var\u003e';\n ```\n2. Grant the following privileges to them:\n\n ```sql\n GRANT REPLICATION SLAVE, SELECT, REPLICATION CLIENT ON *.* TO 'datastream'@'%';\n GRANT EXECUTE ON PROCEDURE mysql.rds_show_configuration TO 'datastream'@'%';\n FLUSH PRIVILEGES;\n ```\n\nWhat's next\n-----------\n\n- Learn more about how Datastream works with [MySQL sources](/datastream/docs/sources-mysql)."]]