Caused by: org.apache.flink.table.api.ValidationException: The MySQL server has a timezone offset (28800 seconds ahead of UTC) which does not match the configured timezone America/New_York. Specify the right server-time-zone to avoid inconsistencies for time-related fields.
flink cdc 由mysql往flink table表里面同步数据时报上面错,是由于flink table创建时数据库服务器中的会话时区设置的不对。
配置上'server-time-zone' = 'Asia/Shanghai' 即可
CREATE TABLE products (
id INT,
name STRING,
description STRING,
PRIMARY KEY (id) NOT ENFORCED
) WITH (
'server-time-zone' = 'Asia/Shanghai',
'connector' = 'mysql-cdc',
'hostname' = '192.168.56.130',
'port' = '3306',
'username' = 'root',
'password' = 'root',
'database-name' = 'cdc',
'table-name' = 'products'
);
文章来源:https://www.toymoban.com/news/detail-777851.html
MySQL CDC 连接器 — CDC Connectors for Apache Flink® documentation文章来源地址https://www.toymoban.com/news/detail-777851.html
到了这里,关于Caused by: org.apache.flink.table.api.ValidationException: The MySQL server has a timezone offset的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!