java 连接数据库报错:Caused by: com.mysql.cj.exceptions.InvalidConnectionAttributeException: The server time zone value '
1、解决方法:
报错信息为:
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:59)
at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:83)
at com.mysql.cj.util.TimeUtil.getCanonicalTimezone(TimeUtil.java:128)
at com.mysql.cj.protocol.a.NativeProtocol.configureTimezone(NativeProtocol.java:2201)
at com.mysql.cj.protocol.a.NativeProtocol.initServerSession(NativeProtocol.java:2225)
at com.mysql.cj.jdbc.ConnectionImpl.initializePropsFromServer(ConnectionImpl.java:1391)
at com.mysql.cj.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:993)
at com.mysql.cj.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:852)
... 17 more
此问题为时区问题,在 JDBC 的连接 url 部分加上 serverTimezone=UTC 即可。
如图:
java 连接数据库报错:Caused by: com.mysql.cj.exceptions.InvalidConnectionAttributeException: The server time zone value '的更多相关文章
- Caused by: com.mysql.cj.exceptions.InvalidConnectionAttributeException: The server time zone value 'Öйú±ê׼ʱ¼ä'
java.sql.SQLException: The server time zone value 'Öйú±ê׼ʱ¼ä' is unrecognized or represents more ...
- 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 serv
z 此问题为时区问题,在 JDBC 的连接 url 部分加上 useSSL=true&serverTimezone=UTC 即可.如图
- com.mysql.cj.exceptions.InvalidConnectionAttributeException: The server time zone value 'PDT' is.......
SpringBoot连接数据库的时候报错 java.sql.SQLException: The server time zone value 'PDT' is unrecognized or repr ...
- com.mysql.cj.exceptions.InvalidConnectionAttributeException: The server time zone value 'Öйú±ê׼ʱ¼ä' is unrecognized or represents more than one time zone. 问题解决方法
一.问题 今天用mybatis连接数据库时出现了如下错误: com.mysql.cj.exceptions.InvalidConnectionAttributeException: The serve ...
- com.mysql.cj.exceptions.InvalidConnectionAttributeException: The server time zone value 'Öйú±ê׼ʱ¼
起初这样能短暂解决问题,后来发现每次机器重启了就还是有这样的错误,还是要执行SQL,很麻烦: show variables like '%time_zone%'; select now(); set ...
- MyBatis——com.mysql.cj.exceptions.InvalidConnectionAttributeException
报错信息 Loading class `com.mysql.jdbc.Driver'. This is deprecated. The new driver class is `com.mysql.c ...
- Java连接MySql报错—— com.mysql.cj.exceptions.InvalidConnectionAttributeException
详细报错 java.sql.SQLException: The server time zone value '�й���ʱ��' is unrecognized or represents mor ...
- c3p0连接池:com.mysql.cj.exceptions.InvalidConnectionAttributeException
1 遇到的错误com.mysql.cj.exceptions.InvalidConnectionAttributeException: 四月 17, 2019 10:21:13 上午 com.mcha ...
- Java连接数据库报错:com.mysql.cj.jdbc.exceptions.CommunicationsException: Communications link failure
解决方案 连接Mysql报错 The last packet sent successfully to the server was 0 milliseconds ago. The driver ha ...
随机推荐
- Jenkins系列-Jenkins升级、迁移和备份
升级Jenkins Jenkins的开发迭代非常快,每周发布一个开发版本,长期支持版每半年更新一次(ps:大版本更新).如此频繁的更新,怎么升级呢? war:下载新版的war文件,替换旧版本war文件 ...
- Firefox火狐浏览器 修改默认搜索引擎
如图:
- OSI参考模型和TCP/IP参考模型
- 【Python】Python中的引用和赋值
本文转自:http://my.oschina.net/leejun2005/blog/145911 在 python 中赋值语句总是建立对象的引用值,而不是复制对象.因此,python 变量更像是指针 ...
- HUAS 1480 虫洞(最短路)
把每个点拆成两个点,分别表示黑洞和白洞,然后按题意模拟加边跑最短路即可. # include <cstdio> # include <cstring> # include &l ...
- C# 代码操作XML(增、删、改)
目录: 1.创建XML 1)创建普通XML 2)创建带属性的XML 2.追加XML 3.读取XML 1)读取普通XML 2)读取带属性的XML 4.修改属性的值 5.删除XML节点 作为一个小型的数 ...
- 转:Conjugate prior-共轭先验的解释
Conjugate prior-共轭先验的解释 原文:http://blog.csdn.net/polly_yang/article/details/8250161 一 问题来源: 看PRML第 ...
- 【刷题】洛谷 P2764 最小路径覆盖问题
题目描述 «问题描述: 给定有向图G=(V,E).设P 是G 的一个简单路(顶点不相交)的集合.如果V 中每个顶点恰好在P 的一条路上,则称P是G 的一个路径覆盖.P 中路径可以从V 的任何一个顶点开 ...
- 【BZOJ5297】【CQOI2018】社交网络(矩阵树定理)
[BZOJ5297][CQOI2018]社交网络(矩阵树定理) 题面 BZOJ 洛谷 Description 当今社会,在社交网络上看朋友的消息已经成为许多人生活的一部分.通常,一个用户在社交网络上发 ...
- 让IE6也支持position:fixed
众所周知IE6不支持position:fixed,这个bug与IE6的双倍margin和不支持PNG透明等bug一样臭名昭著.前些天遇到了这个问题.当时就简单的无视了IE6,但是对于大项目或商业网站, ...