博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Flink 连接 MySQL 错误:The server time zone value ‘Öйú±ê׼ʱ¼ä‘ is unrecognized or represents
阅读量:4071 次
发布时间:2019-05-25

本文共 1556 字,大约阅读时间需要 5 分钟。

Flink 处理好数据后,需要 Sink 到 MySQL 保存,连接的时候报错。

1. 错误描述

Caused by: com.mysql.cj.exceptions.InvalidConnectionAttributeException: The server time zone value 'Öйú±ê׼ʱ¼ä' 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.	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)	at java.lang.reflect.Constructor.newInstance(Constructor.java:423)	at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:59)	at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:83)	at com.mysql.cj.util.TimeUtil.getCanonicalTimezone(TimeUtil.java:128)	at com.mysql.cj.protocol.a.NativeProtocol.configureTimezone(NativeProtocol.java:2201)	at com.mysql.cj.protocol.a.NativeProtocol.initServerSession(NativeProtocol.java:2225)	at com.mysql.cj.jdbc.ConnectionImpl.initializePropsFromServer(ConnectionImpl.java:1391)	at com.mysql.cj.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:993)	at com.mysql.cj.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:852)	... 21 more

2. 解决办法

在 jdbc 连接后面指定 serverTimezone=UTC 就可以了。

'url' = 'jdbc:mysql://localhost:3306/wxc_auto?useUnicode=true&characterEncoding=UTF-8&serverTimezone=UTC'

 

 

转载地址:http://dulji.baihongyu.com/

你可能感兴趣的文章
my ReadBook_liutongjingjixue / circulation economics
查看>>
my ReadBook_wangluoyingxiaoyucehua / network marketing / wangluoyingxiao
查看>>
db base database
查看>>
Spring2.5+MINA2搭建Socket Server
查看>>
jcharts画线图,饼图和柱状图
查看>>
监控服务器端口,Down掉会自动重启,并发送邮件 Linux Shell
查看>>
Git提交错误:RPC failed; result=22, HTTP code = 411
查看>>
Druid使用ConfigFilter
查看>>
Elicpse使用技巧-打开选中文件文件夹或者包的当前目录
查看>>
eclips 运行项目内存不足的解决方案
查看>>
linux 挂载盘阵 smb
查看>>
漫谈 JAVA程序员、架构师、项目经理
查看>>
ceph (luminous 版) crushmap 与 pool结合用于物理划分 IO 使用域
查看>>
mysql 相关索引
查看>>
tomcat7 - cacti 备忘
查看>>
kubernetes 上部署 kubevirt 运行虚拟机
查看>>
kubevirt 对 VMI 调用 CEPH 作为云盘方法
查看>>
powerdns 常见维护备忘
查看>>
kickstart 为 rhel5 创建 ext4 分区
查看>>
linux vlan 配置
查看>>