解决You must configure either the server or JDBC driver (via the serverTimezone configuration property

Posted 无羡

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了解决You must configure either the server or JDBC driver (via the serverTimezone configuration property相关的知识,希望对你有一定的参考价值。

错误提示:
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&characterEncoding=UTF-8,这个是解决中文乱码输入问题,当然也可以和上面的一起结合:jdbc:mysql://127.0.0.1:3306/test?useUnicode=true&characterEncoding=UTF-8&serverTimezone=UTC

以上是关于解决You must configure either the server or JDBC driver (via the serverTimezone configuration property的主要内容,如果未能解决你的问题,请参考以下文章

configure:cannot guess build type; you must specify one

You must configure either the server or JDBC driver (via the ‘serverTimezone‘ configuration property

You must configure either the server or JDBC driver (via the ‘serverTimezone‘ configuration property

Ubuntu : dpkg was interrupted,you must manually run

全网首发:configure: error: cannot guess build type; you must specify one

glibc安装错误error: you must configure in a separate build directory