解决:com.mysql.cj.exceptions.InvalidConnectionAttributeException: The server time zone value '�й���ʱ�
错误信息
Exception in thread "main" 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.at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:129)at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:97)at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:89)at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:63)at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:73)at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:76)at com.mysql.cj.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:835)at com.mysql.cj.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:455)at com.mysql.cj.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:240)at com.mysql.cj.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:199)at java.sql.DriverManager.getConnection(DriverManager.java:664)at java.sql.DriverManager.getConnection(DriverManager.java:247)at com.qst.jdbc.JdbcDemo1.main(JdbcDemo1.java:16)
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 sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)at java.lang.reflect.Constructor.newInstance(Constructor.java:423)at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:61)at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:85)at com.mysql.cj.util.TimeUtil.getCanonicalTimezone(TimeUtil.java:132)at com.mysql.cj.protocol.a.NativeProtocol.configureTimezone(NativeProtocol.java:2243)at com.mysql.cj.protocol.a.NativeProtocol.initServerSession(NativeProtocol.java:2267)at com.mysql.cj.jdbc.ConnectionImpl.initializePropsFromServer(ConnectionImpl.java:1319)at com.mysql.cj.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:966)at com.mysql.cj.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:825)... 6 more
此问题为时区问题,在 JDBC 的连接 url 部分加上 serverTimezone=UTC 即可。
解决:com.mysql.cj.exceptions.InvalidConnectionAttributeException: The server time zone value '�й���ʱ�相关推荐
- 解决:Caused by: com.mysql.cj.exceptions.InvalidConnectionAttributeException: The server time zone valu
解决:Caused by: com.mysql.cj.exceptions.InvalidConnectionAttributeException: The server time zone valu ...
- Caused by: com.mysql.cj.exceptions.InvalidConnectionAttributeException: The server time zone value '
如果我的博客能够帮到大家能够点个赞,关注一下,以后还会更新更过JavaWeb的高级技术,大家的支持就是我继续更新的动力.谢谢. 今天在使用SpringBoot 链接数据库,测试得时候出现了以下错误: ...
- Caused by: com.mysql.cj.exceptions.InvalidConnectionAttributeException: The server time zone value
Caused by: com.mysql.cj.exceptions.InvalidConnectionAttributeException: The server time zone value ' ...
- com.mysql.cj.exceptions.InvalidConnectionAttributeException: The server time zone valu
MySQL连接报错 com.mysql.cj.exceptions.InvalidConnectionAttributeException: The server time zone valu 此问题 ...
- com.mysql.cj.exceptions.InvalidConnectionAttributeException: The server time zone value '�й���ʱ��'
解决方案: 为URL添加参数: jdbc:mysql://localhost:3306/zcw_test?useUnicode=true&characterEncoding=UTF-8& ...
- 解决连接mysql数据库出现Caused by: com.mysql.cj.exceptions.InvalidConnectionAttributeException: The server tim
这里写自定义目录标题 解决连接mysql数据库出现Caused by: com.mysql.cj.exceptions.InvalidConnectionAttributeException: The ...
- 连接mysql报错Caused by: com.mysql.cj.exceptions.InvalidConnectionAttributeException: The server time zon
连接mysql报错: Caused by: com.mysql.cj.exceptions.InvalidConnectionAttributeException: The server time z ...
- hive启动失败 显示:Caused by: com.mysql.cj.exceptions.InvalidConnectionAttributeException: The server time
标题[报错]Caused by: com.mysql.cj.exceptions.InvalidConnectionAttributeException: The server time zone v ...
- Datagrip连接MySQL数据遇到com.mysql.cj.exceptions.InvalidConnectionAttributeException问题
使用Datagrip连接MySQL数据,用户名和密码正确的情况下,出现以下问题: java.lang.RuntimeException: com.mysql.cj.exceptions.Invalid ...
最新文章
- 教育部:禁止开学前网授新学期课程
- 算法笔记-异或的使用、异或算法面试题、详细解析、异或的理解与其使用规律
- LinearAlgebra_3
- (三) Angular2项目框架搭建心得
- 啊这,C++现在学还来的及吗?
- 回文子序列_计算回文子序列的总数
- 【codevs1368】【BZOJ1034】泡泡堂BNB,贪心思路
- java数组的初始化方式
- 交叉编译iptables1.4.12的问题
- 德鲁伊 oltp oltp_内存中OLTP –娱乐看门狗的三个关键点–桶数
- wcf中如何Host多个WCF服务?
- kibana如何使用linux命令,Kibana 用户指南(安装Kibana)
- 机器学习常见算法分类
- 央行数字货币——DCEP的那些事儿
- FTP下载文件夹到windows
- java中alt_eclipse中alt+/的作用
- 「好书推荐」《边城》沈从文的乡土情怀代表作,汪曾祺、林徽因、曹文轩等真情推荐!
- matlab建立模糊规则表,请教matlab怎样建立模糊控制查询表?
- iphone4卡贴机(有锁版)解决通话长途助理以及号码不显示的解决办法
- 用python制作田字格_2分钟学会在Word中制作田字格 米字格 书法练字再也不用买本子了...