1.错误
在做maven +springboot + mybatis 项目 连接数据库报错
Caused by: com.mysql.cj.exceptions.InvalidConnectionAttributeException: 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.
2.解决
修改配置文件 application.properties
### mysql数据库连接信息
spring.datasource.url=jdbc:mysql://127.0.0.1:3306/springboot?serverTimezone=Asia/Shanghai
加上了 ?serverTimezone=Asia/Shanghai
原因时区报错
本文详细介绍了在使用Maven、SpringBoot和MyBatis进行项目开发时,遇到的数据库连接时区报错问题及其解决方案。通过修改application.properties配置文件中的时区设置,成功解决了因时区不匹配导致的数据库连接异常。

1496

被折叠的 条评论
为什么被折叠?



