Mit Sammlungen den Überblick behalten
Sie können Inhalte basierend auf Ihren Einstellungen speichern und kategorisieren.
In den folgenden Abschnitten wird beschrieben, wie Sie CDC für eine selbstverwaltete MySQL-Datenbank konfigurieren.
Diese Anleitung funktioniert auch für Datenbanken wie MariaDB, Percona Server for MySQL oder Alibaba Cloud PolarDB.
Konfiguration und Aufbewahrungsdauer des binären Logs prüfen
Prüfen Sie mit dem folgenden MySQL-Befehl, ob das binäre Log ordnungsgemäß konfiguriert ist:
SHOWGLOBALVARIABLESLIKE'%binlog_format%';
Prüfen Sie, ob der Wert für die Variable binlog_format auf ROW festgelegt ist.
Datastream unterstützt die binlog-Formate MIXED und STATEMENT nicht.
Prüfen Sie mit dem folgenden MySQL-Befehl, ob das Zeilenformat für das binäre Log auf FULL gesetzt ist:
SHOWGLOBALVARIABLESLIKE'binlog_row_image';
Prüfen Sie mit dem folgenden MySQL-Befehl, ob die Replikat-Updates-Option für das binäre Log auf ON gesetzt ist:
SHOWGLOBALVARIABLESLIKE'log_replica_updates';
Geben Sie für MySQL-Versionen vor 8.0.26 stattdessen den folgenden Befehl ein:
SHOWGLOBALVARIABLESLIKE'log_slave_updates';
Prüfen Sie mit dem folgenden MySQL-Befehl, ob als Aufbewahrungsdauer für das binäre Log 604800 Sekunden (7 Tage) festgelegt sind:
[[["Leicht verständlich","easyToUnderstand","thumb-up"],["Mein Problem wurde gelöst","solvedMyProblem","thumb-up"],["Sonstiges","otherUp","thumb-up"]],[["Schwer verständlich","hardToUnderstand","thumb-down"],["Informationen oder Beispielcode falsch","incorrectInformationOrSampleCode","thumb-down"],["Benötigte Informationen/Beispiele nicht gefunden","missingTheInformationSamplesINeed","thumb-down"],["Problem mit der Übersetzung","translationIssue","thumb-down"],["Sonstiges","otherDown","thumb-down"]],["Zuletzt aktualisiert: 2025-08-12 (UTC)."],[[["\u003cp\u003eThis guide provides instructions for configuring Change Data Capture (CDC) for self-managed MySQL databases, including MariaDB, Percona Server, and Alibaba Cloud PolarDB.\u003c/p\u003e\n"],["\u003cp\u003eThe binary log must be configured with \u003ccode\u003eROW\u003c/code\u003e format, \u003ccode\u003eFULL\u003c/code\u003e row image, and replica updates enabled, using specific MySQL commands to verify these settings.\u003c/p\u003e\n"],["\u003cp\u003eThe binary log retention period must be set to 604800 seconds (7 days), and instructions are given to modify the \u003ccode\u003emy.cnf\u003c/code\u003e file to ensure this and other relevant settings.\u003c/p\u003e\n"],["\u003cp\u003eA Datastream user needs to be created and granted specific privileges, such as \u003ccode\u003eREPLICATION SLAVE\u003c/code\u003e, \u003ccode\u003eSELECT\u003c/code\u003e, and \u003ccode\u003eREPLICATION CLIENT\u003c/code\u003e, for CDC operations.\u003c/p\u003e\n"],["\u003cp\u003eSpecific commands are required to confirm and setup binlogs, as well as creating the Datastream user.\u003c/p\u003e\n"]]],[],null,[]]