flink-cdc icon indicating copy to clipboard operation
flink-cdc copied to clipboard

How to do MySQL to MySQL pipeline

Open ysmintor opened this issue 2 years ago • 5 comments

Hi, I just found out demo of MySQL to Doris, But I want to do a whole sync database of MySQL to another MySQL. flink-cdc-pipeline-connector-mysql is just for source. How about the sink still is MySQL?

Cloud anyone tell me some information to implement.

ysmintor avatar Mar 13 '24 11:03 ysmintor

you can create sink mysql table

CREATE TABLE mysql_sink (
  `id`  bigint ,
  `s_name` varchar(100)  ,
  `s_int` bigint,
 PRIMARY KEY(id) NOT ENFORCED 
) WITH (
 'connector' = 'jdbc',
'driver' = 'com.mysql.cj.jdbc.Driver',
'url' = 'jdbc:mysql://192.168.1.15:3306/cdc?serverTimezone=UTC&useSSL=false',
 'username' = 'root',
 'password' = '111111',
 'table-name' = 't_t'
);


insert into mysql_sink select * from cdc_table

ihadoop avatar Mar 14 '24 09:03 ihadoop

@ihadoop Thanks for you reply. But your method means that I have to create every table which is to not a suit case like pipeline way to sync MySQL database into Doris with each table has the corresponding tables in Doris database.

ysmintor avatar Mar 14 '24 13:03 ysmintor

Owner said mysql2mysql still not support even though there is source code

KiwiGeorge avatar Mar 26 '24 03:03 KiwiGeorge

Owner said mysql2mysql still not support even though there is source code

Oh, Thank you. I have found some DataStream method to handle which take CDC DDL to create corelated table in sink. I also found third party Dinky which is a streaming process platform based on Flink that already implement MySQL to MySQL in their way. So I hope at someday FlinkCDC 3.0+ will implement those features.

ysmintor avatar Mar 27 '24 13:03 ysmintor

Closing this issue as it has been migrated to Apache Jira.

PatrickRen avatar Apr 09 '24 05:04 PatrickRen