You can use MySQL Binlog Reader to read data from tables in your MySQL database in real time by subscribing to real-time binlogs.
When the binlog writing feature is enabled for a read-only database and the binlog-format parameter is set to ROW, MySQL Binlog Reader can read data from this read-only database.
- Go to the DataStudio page.
- Log on to the DataWorks console.
- In the left-side navigation pane, click Workspaces.
- Select the region where the required workspace resides, find the workspace, and then click Data Analytics.
- Move the pointer over the icon and choose .Alternatively, you can click the required workflow, right-click Data Integration, and then choose .
- In the Create Node dialog box, set the Node Name and Location parameters.Notice The node name must be 1 to 128 characters in length. It can contain letters, digits, underscores (_), and periods (.).
- Click Commit.
- On the configuration tab of the real-time sync node, click and drag MySQL Binlog to the canvas on the right.
- Click the MySQL Binlog component node. In the panel that appears, set the parameters in the Node configuration section.
Parameter Description Data source The connection to the MySQL Binlog data store that you have configured. In this example, you can only select a MySQL Binlog connection.
If no connection can be used, click New data source on the right to create one on the page.
Table The name of the table from which data is to be synchronized in the specified data store. You can click Data preview on the right to preview the selected table.In the case of database and table sharding, data can be synchronized from multiple databases and tables in real time.Notice To avoid errors, the tables in database shards and table shards must use the same schema. Output field The fields to be synchronized, including management fields and data fields.
- Manage fields: additional fields that are automatically added when the fields in the source tables are synchronized to the destination database. These fields facilitate data management, sorting, and deduplication.
- Data Field: the fields in the raw tables to be synchronized.
For more information, see Fields used for real-time synchronization.MySQL Binlog Reader supports database and table sharding. To use this feature, click Add a database and table data source and select the data stores and tables from the drop-down lists to synchronize data from multiple tables and databases.Notice To avoid errors, the selected tables must use the same schema.
- Click the icon in the toolbar.