环境:
Jdk

Mysql

mysql驱动程序:

Sringboot:

问题:
Error querying database. Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested exception is 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.

解决方案:

图中红框中url内容修改为:
url: jdbc:mysql://localhost:3306/testMyBatisPlus?useUnicode=true&characterEncoding=utf8&serverTimezone=PRC
本Bug到此为止,下个见......
本文介绍了如何解决Spring Boot应用连接MySQL时遇到的时区配置错误问题,通过修改数据库连接URL中的时区参数来避免异常。

438

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



