Stay organized with collections
Save and categorize content based on your preferences.
The following sections cover how to configure CDC for a self-managed MySQL database.
These instructions also work for databases such as MariaDB, Percona Server for
MySQL or Alibaba Cloud PolarDB.
Verify the configuration and retention period of the binary log
Confirm that the binary log is configured correctly by entering the following MySQL command:
SHOWGLOBALVARIABLESLIKE'%binlog_format%';
Verify that the value for the binlog_format variable is set to ROW.
Datastream doesn't support MIXED or STATEMENT binary log
formats.
Confirm that the row format for the binary log is set to FULL by entering
the following MySQL command:
SHOWGLOBALVARIABLESLIKE'binlog_row_image';
Verify that the replica updates option for the binary log is set to ON by
entering the following MySQL command:
SHOWGLOBALVARIABLESLIKE'log_replica_updates';
For MySQL versions earlier than 8.0.26, enter the following command instead:
SHOWGLOBALVARIABLESLIKE'log_slave_updates';
Verify that the retention period of the binary log is set to 604800
seconds (7 days) by entering the following MySQL command:
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-07 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,[]]