1....You must configure either the server or JDBC driver (via the serverTimezone configuration property)
使用JDBC连接MySql时出现: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
错误提示:
Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get 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.
解决办法;
在连接字符串后面加上?serverTimezone=UTC
其中UTC是统一标准世界时间。
完整的连接字符串示例:jdbc:mysql://localhost:3306/test?serverTimezone=UTC
或者还有另一种选择:jdbc:mysql://127.0.0.1:3306/test?useUnicode=true&characte

当遇到MySQL连接错误提示'The server time zone value is unrecognized...'时,可以通过在JDBC连接字符串中添加`?serverTimezone=UTC`来解决。本文详细介绍了问题背景、解决方法以及如何同时解决中文乱码问题,并提供了相关资源链接,如GeoServer添加MySQL数据源和电子地图下载工具。
最低0.47元/天 解锁文章
1752

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



