启动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设置参数

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

粘贴下面:

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

 

你可能感兴趣的:(SpringBoot)