连接mysql报错Caused by: com.mysql.cj.exceptions.InvalidConnectionAttributeException: The server time zon

Posted zhangphil

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了连接mysql报错Caused by: com.mysql.cj.exceptions.InvalidConnectionAttributeException: The server time zon相关的知识,希望对你有一定的参考价值。

连接mysql报错:

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.

如图:

 解决方案,在连接mysql的jdbc的url拼上&serverTimezone=UTC,比如:

jdbc:mysql://127.0.0.1:3306/你的数据库名称?useUnicode=true&characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull&serverTimezone=UTC

以上是关于连接mysql报错Caused by: com.mysql.cj.exceptions.InvalidConnectionAttributeException: The server time zon的主要内容,如果未能解决你的问题,请参考以下文章

idea连接spark集群报错解析:Caused by: java.lang.ClassCastException

用SSH连接oracle数据库出错。Caused by: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException

mysql 保存emoji时报,数据库报错:Caused by: java.sql.SQLException: Incorrect string value: 'xF0x9Fx98x8(示例代

elaseticsearchelaseticsearch启动报错Caused by: org.elasticsearch.transport.BindTransportException: Fai(代

hive报错:Caused by: ERROR XBM0H: Directory /var/lib/hive/metastore/metastore_db cannot be created.(示例代

解决sqoop导入报错:Caused by: java.sql.SQLException: Protocol violation