当前位置: 移动技术网 > IT编程>开发语言>Java > SpringBoot连接MySQL8.0报错:-The Server time zone value ‘�й���׼ʱ��’ is unrecognized or represents more

SpringBoot连接MySQL8.0报错:-The Server time zone value ‘�й���׼ʱ��’ is unrecognized or represents more

2020年07月14日  | 移动技术网IT编程  | 我要评论

报错信息:

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.
    at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:129) ~[mysql-connector-java-8.0.16.jar:8.0.16]

解决方法:

在配置文件application.properties中,spring.datasource.url改为

spring.datasource.url=jdbc:mysql://localhost:3306/你的数据库名称?serverTimezone=UTC&useUnicode=true&characterEncoding=utf8&useSSL=true

即增加:serverTimezone=UTC

 

本文地址:https://blog.csdn.net/qq_41138935/article/details/107311139

如对本文有疑问, 点击进行留言回复!!

相关文章:

验证码:
移动技术网