坑The server time zone value '?й???????' is unrecognized or represents more than one time z(代

Posted yrzf

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了坑The server time zone value '?й???????' is unrecognized or represents more than one time z(代相关的知识,希望对你有一定的参考价值。

在使用spring JDBC 连接数据库时出现的错误:

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.


 at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
 at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
 at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
 at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:500)

解决办法:在setUrl 数据库后面添加:

?serverTimezone=UTC

技术图片

 

 

 

以上是关于坑The server time zone value '?й???????' is unrecognized or represents more than one time z(代的主要内容,如果未能解决你的问题,请参考以下文章

Mysql错误:The server time zone value is unrecognized or represents more than one time zone

The server time zone value '?й???????' is unrecognized or represents more than one time zone

MySQLjava.sql.SQLException: The server time zone value

连接mysql报错:The server time zone value ‘‘ is unrecognized or represents more than one time zone.

连接mysql报错:The server time zone value ‘‘ is unrecognized or represents more than one time zone.

The server time zone value '?й???????' is unrecognized or represents more than one time zone