spring boot +mysql 报The server time zone value '�й���׼ʱ��' is unrecognized。。。。

spring boot+mybatis 启动报错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

其中集成的mysql 驱动版本是 mysql-connector-java-8.0.19,所以才会报这个错误

解决方案:

1.可以指定其他版本的mysql connector 根据自己数据库版本来设定

2.或者在spring boot 配置文件中datasource url 增加serverTimezone=UTC 参数,其中UTC是统一标准世界时间

datasource:
name: dev
url: jdbc:mysql://127.0.0.1:3306/leopard?serverTimezone=UTC&useUnicode=true&charaterEncoding=utf-8&useSSL=false
username: root
password: 123456

原文链接:https://blog.csdn.net/u012581020/article/details/104539022

你可能感兴趣的:(个人学习日志)