mysql连接异常:The server time zone value '�й���׼ʱ��' is unrecognized or represents more than one time zo

原文链接:https://blog.csdn.net/LFF1991/article/details/77196490 

错误信息如下: 
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。。。

错误原因:mysql识别时区出现错误,这是因为访问的url中没有指定时区为UTC 
出错误的url:

jdbc.url=jdbc:mysql://localhost:3306/seckill?useUnicode=true&characterEncoding=utf8

在后面添加时区的参数数即可:

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

猜你喜欢

转载自blog.csdn.net/qq_39362996/article/details/86187030
今日推荐