0%

MySQL时出现The server time zone value '[][][][]' unrecogni的解决方法

异常情况:

1
2

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后面加上:

1
?serverTimezone=UTC

如下:

1
2
3
4

spring.datasource.url = jdbc:mysql://localhost:3306/DB?characterEncoding=utf8&serverTimezone=UTC
spring.datasource.username = root
spring.datasource.password = 123456
layicr 微信

微信

layicr 支付宝

支付宝