Configurer une base de données MySQL Amazon Aurora
Restez organisé à l'aide des collections
Enregistrez et classez les contenus selon vos préférences.
Les sections suivantes expliquent comment configurer la CDC pour une base de données Amazon Aurora MySQL.
Créer un groupe de paramètres
Lancez votre tableau de bord Amazon RDS.
Dans le panneau de navigation, cliquez sur Groupes de paramètres.
Cliquez sur Créer un groupe de paramètres. La page Créer un groupe de paramètres s'affiche.
Renseignez les champs de cette page à l'aide du tableau suivant :
Champ
Description
Famille de groupe de paramètres
Sélectionnez la famille qui correspond à votre base de données.
Type
Sélectionnez le groupe de paramètres du cluster de base de données.
Nom du groupe
Saisissez un nom pour le groupe de paramètres.
Description
Saisissez une description pour le groupe de paramètres.
Cliquez sur Créer.
Cochez la case à gauche du groupe de paramètres que vous venez de créer.
Sous Actions associées au groupe de paramètres, cliquez sur Modifier.
Définissez les valeurs de paramètre suivantes :
Pour la réplication basée sur GTID :
Paramètre
Valeur
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 (valeur recommandée)
log-replica-updates
1
enforce-gtid-consistency
ON
gtid_mode
ON
Vous ne pouvez définir ce paramètre sur ON qu'après avoir défini enforce-gtid-consistency sur ON. En général, gtid_mode peut avoir les valeurs suivantes :
OFF
OFF_PERMISSIVE
ON_PERMISSIVE
ON
Vous ne pouvez modifier les valeurs du paramètre gtid_mode qu'une étape à la fois. Par exemple, si le mode actuel est défini sur OFF, procédez comme suit :
Découvrez comment Datastream fonctionne avec les sources MySQL.
Sauf indication contraire, le contenu de cette page est régi par une licence Creative Commons Attribution 4.0, et les échantillons de code sont régis par une licence Apache 2.0. Pour en savoir plus, consultez les Règles du site Google Developers. Java est une marque déposée d'Oracle et/ou de ses sociétés affiliées.
Dernière mise à jour le 2025/09/04 (UTC).
[[["Facile à comprendre","easyToUnderstand","thumb-up"],["J'ai pu résoudre mon problème","solvedMyProblem","thumb-up"],["Autre","otherUp","thumb-up"]],[["Difficile à comprendre","hardToUnderstand","thumb-down"],["Informations ou exemple de code incorrects","incorrectInformationOrSampleCode","thumb-down"],["Il n'y a pas l'information/les exemples dont j'ai besoin","missingTheInformationSamplesINeed","thumb-down"],["Problème de traduction","translationIssue","thumb-down"],["Autre","otherDown","thumb-down"]],["Dernière mise à jour le 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)."]]