1、解决方法:

报错信息为:

  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.
  2. at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
  3. at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
  4. at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
  5. at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
  6. at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:59)
  7. at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:83)
  8. at com.mysql.cj.util.TimeUtil.getCanonicalTimezone(TimeUtil.java:128)
  9. at com.mysql.cj.protocol.a.NativeProtocol.configureTimezone(NativeProtocol.java:2201)
  10. at com.mysql.cj.protocol.a.NativeProtocol.initServerSession(NativeProtocol.java:2225)
  11. at com.mysql.cj.jdbc.ConnectionImpl.initializePropsFromServer(ConnectionImpl.java:1391)
  12. at com.mysql.cj.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:993)
  13. at com.mysql.cj.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:852)
  14. ... 17 more

此问题为时区问题,在 JDBC 的连接 url 部分加上 serverTimezone=UTC 即可。
如图:

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 'Öйú±ê׼ʱ¼ä'

    java.sql.SQLException: The server time zone value 'Öйú±ê׼ʱ¼ä' is unrecognized or represents more ...

  2. 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 即可.如图

  3. 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 ...

  4. 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 ...

  5. com.mysql.cj.exceptions.InvalidConnectionAttributeException: The server time zone value 'Öйú±ê׼ʱ¼

    起初这样能短暂解决问题,后来发现每次机器重启了就还是有这样的错误,还是要执行SQL,很麻烦: show variables like '%time_zone%'; select now(); set ...

  6. MyBatis——com.mysql.cj.exceptions.InvalidConnectionAttributeException

    报错信息 Loading class `com.mysql.jdbc.Driver'. This is deprecated. The new driver class is `com.mysql.c ...

  7. Java连接MySql报错—— com.mysql.cj.exceptions.InvalidConnectionAttributeException

    详细报错 java.sql.SQLException: The server time zone value '�й���׼ʱ��' is unrecognized or represents mor ...

  8. c3p0连接池:com.mysql.cj.exceptions.InvalidConnectionAttributeException

    1 遇到的错误com.mysql.cj.exceptions.InvalidConnectionAttributeException: 四月 17, 2019 10:21:13 上午 com.mcha ...

  9. 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 ...

随机推荐

  1. CentOS基础命令

    为网卡配置静态IP地址建议通过交互式界面nmtui进行配置 firewalld和iptablesCentOS7使用firewald取代原来的iptables,但实际上底层还是iptables,在上层加 ...

  2. linux+Nginx+Mysql+PHP环境下,安装mysqli模块

    奶奶的腿儿啊,太不易了.倒腾了小半天儿,写此随笔,待后查. 阿里云ecs中,安装phpcms,出现了一个问题:环境检测的时候,一直提示 Mysqli扩展没开启. 老夫哪儿特么会这么专业的啊...能咋办 ...

  3. docker配置网络

    1.暂停服务,删除旧网桥#service docker stop#ip link set dev docker0 down#brctl delbr docker0 2.创建新网桥bridge0#brc ...

  4. udp->ip & tcp->ip 发送数据包的目的地址的源地址是什么时候确定的?

    udp->ip & tcp->ip udp到ip层是:ip_send_skb tcp到ip层是: ip_queue_xmit 拿tcp为例,在使用[ip_queue_xmit, i ...

  5. Go语言【第九篇】:Go数据结构之:数组

    Go语言数组 Go语言提供了数组类型的数据结构.数组时具有相同唯一类型的一组已编号且长度固定的数据项序列,中类型可以是任意的原始类型如整形.字符串或者自定义类型. 相对于声明number0,numbe ...

  6. C# 面向对象——多态

    多态分三种:1.虚方法 2.抽象类 3.接口 1.虚方法1.将父类的方法标记为虚方法 ,使用关键字 virtual,这个函数可以被子类重新写一个遍. 如: class Program { static ...

  7. Ubuntu 10.04 下载android 4.1.1_r4

    一.安装 curl git $ sudo apt-get install  curl $ sudo apt-get install git-core 二.安装repo 1.在主目录(~)建立目录 bi ...

  8. POJ3581:Sequence——题解

    http://poj.org/problem?id=3581 给一串数,将其分成三个区间并且颠倒这三个区间,使得新数列字典序最小. 参考:http://blog.csdn.net/libin56842 ...

  9. POJ1006:Biorhythms——题解

    http://poj.org/problem?id=1006 题目大意: 人生来就有三个生理周期,分别为体力.感情和智力周期,它们的周期长度为23天.28天和33天.每一个周期中有一天是高峰.在高峰这 ...

  10. BZOJ5248:[九省联考2018]一双木棋——题解

    https://www.lydsy.com/JudgeOnline/problem.php?id=5248 https://www.luogu.org/problemnew/show/P4363#su ...