项目启动报错 The server time zone value '�й���׼ʱ��' is unrecognize...

背景介绍:

把项目在新的电脑上运行,MySQL版本不同出现错误

错误:

报错The server time zone value '�й���׼ʱ��' is unrecognized or represents more than one time zone. You must...

原因:

是使用了Mysql Connector/J 6.x以上的版本,然后就报了时区的错误

解决方法:

在配置url的时候不能简单写成 :

jdbc.url=jdbc:mysql://localhost:3306/demo?useUnicode=true&characterEncoding=utf8&useSSL=false

改写成 :

jdbc.url=jdbc:mysql://localhost:3306/demo?serverTimezone=UTC&useUnicode=true&characterEncoding=utf8&useSSL=false

猜你喜欢

转载自www.cnblogs.com/wangxue1314/p/12677729.html
今日推荐