Skip to content

mysql binlog方式同步,如何从最开始位置开始同步 #913

@13668215435

Description

@13668215435

当同步mysql binlog日志时,sql方式无配置项指定从数据的最开始位置(即全量)开始同步;每次启动作业都是默认从最新的binlog位置开始同步,有无配置项控制binlog的消费位置?

binlog_mysql.sql:

CREATE TABLE source
(
id int,
name varchar(20),
sex varchar(10),
ts timestamp
) WITH (
'connector' = 'binlog-x'
,'username' = 'root'
,'password' = '123456'
,'cat' = 'insert,delete,update'
,'url' = 'jdbc:mysql://localhost:3306/test_cdc?useSSL=false'
,'host' = 'localhost'
,'port' = '3306'
,'table' = 'test_cdc.cdc_flink'
,'timestamp-format.standard' = 'SQL'
);

CREATE TABLE sink
(
id int,
name varchar(20),
sex varchar(10),
ts timestamp
) WITH (
'connector' = 'stream-x',
'print' = 'true'
);

insert into sink
select id,name,sex,ts
from source u;

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions