Configura una base de datos de Amazon Aurora MySQL
Organiza tus páginas con colecciones
Guarda y categoriza el contenido según tus preferencias.
En las siguientes secciones, se explica cómo configurar la CDC para una base de datos de Amazon Aurora MySQL.
Crea un grupo de parámetros
Inicia el panel de Amazon RDS.
En el panel lateral de navegación, haz clic en Grupos de parámetros.
Haz clic en Crear grupo de parámetros. Aparecerá la página Create Parameter Group.
Usa la siguiente tabla para completar los campos de esta página:
Campo
Descripción
Familia de grupos de parámetros
Selecciona la familia que coincide con tu base de datos.
Tipo
Selecciona Grupo de parámetros del clúster de la base de datos.
Nombre del grupo
Proporciona un nombre para el grupo de parámetros.
Descripción
Proporciona una descripción para el grupo de parámetros.
Haz clic en Crear.
Selecciona la casilla de verificación que se encuentra a la izquierda del grupo de parámetros recién creado.
En Acciones del grupo de parámetros, haz clic en Editar.
Establece los siguientes valores de parámetros:
Para la replicación basada en GTID, haz lo siguiente:
Parámetro
Valor
binlog_format
ROW
log_bin_use_v1_row_events
1
read_only
0
net_read_timeout
3600
net_write_timeout
3600
wait_timeout
86400
expire-logs-days
7
binlog_row_image
FULL
max_allowed_packet
1G (valor recomendado)
log-replica-updates
1
enforce-gtid-consistency
ON
gtid_mode
ON
Solo puedes establecer este parámetro en ON después de establecer enforce-gtid-consistency en ON. En general, gtid_mode puede tener los siguientes valores:
OFF
OFF_PERMISSIVE
ON_PERMISSIVE
ON
Solo puedes cambiar los valores del parámetro gtid_mode de a un paso por vez. Por ejemplo, si el modo actual está configurado como OFF, haz lo siguiente:
Cambia el parámetro de configuración a OFF_PERMISSIVE.
Cambia el parámetro de configuración a ON_PERMISSIVE.
[[["Fácil de comprender","easyToUnderstand","thumb-up"],["Resolvió mi problema","solvedMyProblem","thumb-up"],["Otro","otherUp","thumb-up"]],[["Difícil de entender","hardToUnderstand","thumb-down"],["Información o código de muestra incorrectos","incorrectInformationOrSampleCode","thumb-down"],["Faltan la información o los ejemplos que necesito","missingTheInformationSamplesINeed","thumb-down"],["Problema de traducción","translationIssue","thumb-down"],["Otro","otherDown","thumb-down"]],["Última actualización: 2025-09-04 (UTC)"],[[["\u003cp\u003eBefore setting up Change Data Capture (CDC) for an Amazon Aurora MySQL database, you must have an existing Aurora cluster and be connected to the Writer endpoint of your master database server.\u003c/p\u003e\n"],["\u003cp\u003eA new DB Cluster Parameter Group should be created via the Amazon RDS Dashboard, selecting the correct family and type, and defining a unique name and description for it.\u003c/p\u003e\n"],["\u003cp\u003eWithin the Parameter Group, certain values need to be adjusted like \u003ccode\u003ebinlog_format\u003c/code\u003e to \u003ccode\u003eROW\u003c/code\u003e for both GTID and binlog based replication, along with other specific settings that are recommended, before saving the changes.\u003c/p\u003e\n"],["\u003cp\u003eThe parameter group must be applied to your database instance via the Amazon RDS dashboard, with the backup retention period set to 7 days, and then applied immediately.\u003c/p\u003e\n"],["\u003cp\u003eTo ensure proper replication, the binary log retention period must be set to a minimum of 7 days (168 hours) using a MySQL command and a new user 'datastream' must be created with specific replication and execution privileges.\u003c/p\u003e\n"]]],[],null,["# Configure an Amazon Aurora MySQL database\n\nThe following sections cover how to configure CDC for an Amazon Aurora MySQL database.\n| Before configuring CDC for your Amazon Aurora MySQL database, make sure that you have an existing Aurora cluster and that you have connected to the Writer endpoint of your primary database server.\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. Use the following table to populate the fields of this page:\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. Set the following parameter values:\n\n - For **GTID-based** replication:\n\n - For **binlog-based** replication:\n\n9. Click **Save Changes**.\n\nAssign the parameter group to the database instance\n---------------------------------------------------\n\n1. Launch your Amazon RDS Dashboard.\n\n2. In the **Navigation Drawer** , click **Databases**, and then select your database instance.\n\n3. From the **Instance Actions** menu, select **Modify** . The **Modify DB Instance** dialog appears.\n\n4. In the **Additional configuration** section, select the database cluster parameter group that you [created](#create-a-parameter-group-aurora).\n\n5. Set the **Backup retention period** to **7 days**.\n\n6. Click **Continue**.\n\n7. In the **Scheduling of Modifications** pane, select the **Apply immediately** option.\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)."]]