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

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

出错误的url:

spring.datasource.url=jdbc:mysql://127.0.0.1:3306/springbootdemo?useUnicode=true&characterEncoding=utf8

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

spring.datasource.url=jdbc:mysql://127.0.0.1:3306/springbootdemo?useUnicode=true&characterEncoding=utf8&serverTimezone=UTC

 

posted @ 2020-01-26 23:32  ZERSOG  阅读(1542)  评论(1编辑  收藏  举报