jdbc维表报:The server time zone value‘XXX’
更新时间: 2024-03-11 02:49:39
阅读 964
The server time zone value‘XXX’ is unrecognized or represents more than one time zone. You must configure either the server or JDBC driver (via the serverTimezone configuration property) to use a more specifc time zone value if you want to utilize time zone support.
此异常由系统时间与数据库时间差异导致,针对这种情况需要在jdbc链接信息后面添加serverTimezone=Asia/Shanghai
。
例如:
CREATE TABLE user_log_sink(
`table` VARCHAR,
item_id VARCHAR,
sub VARCHAR,
subr VARCHAR
) WITH (
'connector.type' = 'jdbc',
'connector.url' = 'jdbc:mysql://localhost:3306/test?serverTimezone=Asia/Shanghai',
'connector.table' = 'user_log',
'connector.driver' = 'com.mysql.jdbc.Driver',
'connector.username' = 'your_username',
'connector.password' = 'your_password',
'connector.write.flush.max-rows' = '1',-- jdbc写入缓存的最大行数。默认值5000
'connector.write.flush.interval' = '1s', -- jdbc 写入缓存flush时间间隔。默认为0,立即写入
'connector.write.max-retries' = '3'
);
GMT%2B8:东八区区时 GMT : 格林威治标准时间
文档反馈
以上内容对您是否有帮助?