|
hi:
在学习实践 pyflink(1.12.0v)的mysql-cdc模式时遇到数据无法显示的问题,烦请大牛们看看啥原因
源头数据库是mysql(5.7 v)的,已经打开了binlog模式,源数据表定义如下
CREATE TABLE test (
id int,
name string,
age int,
PRIMARY KEY (id) NOT ENFORCED
) WITH (
'connector' = 'mysql-cdc',
'hostname' = '10.11.33.195',
'port' = '3306',
'username' = 'root',
'password' = 'ha@123',
'server-id' = '123',
'database-name' = 'mysql',
'table-name' = 'zk_test'
)
显示源表数据的代码
t_env.execute_sql('select id,name,age from test where id > 0').print()
服务器上提交python脚本执行后,显示如下
+----+-------------+--------------------------------+-------------+
| op | id | name | age |
+----+-------------+--------------------------------+-------------+
Apr 15, 2021 2:27:15 PM com.github.shyiko.mysql.binlog.BinaryLogClient connect
INFO: Connected to 10.11.33.195:3306 at mysql-bin.000001/10303 (sid:123, cid:87)
源头mysql库的zk_test表里有几条数据,但就是无法显示出来,数据库表插入新记录后也没有数据显示出来
lib目录已经放置了相关 connector.jar 包
|