启动SpringBoot项目连接Mysql时区无法识别:java.sql.SQLException: The server time zone value '�й���׼ʱ��' is unrecog

一、错误信息

java.sql.SQLException: 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.
 

 

二、解决办法

将连接mysql的url设置参数

粘贴下面:

url: jdbc:mysql://127.0.0.1:3306/{databaseName}?useSSL=false&useUnicode=true&characterEncoding=utf-8&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=UTC

 

posted @ 2020-02-07 13:07  CHANGEMAX  阅读(136)  评论(0编辑  收藏  举报