在使用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 zone.的更多相关文章

  1. Exception in thread “main” java.sql.SQLException: The server time zone value ‘�й���׼ʱ��’ is unrecognized or represents more than one time zone.

    Exception in thread “main” java.sql.SQLException: The server time zone value ‘�й���׼ʱ��’ is unrecogn ...

  2. idea报错: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 configu

    java.sql.SQLException: The server time zone value '�й���׼ʱ��' is unrecognized or represents more tha ...

  3. The server time zone value '�й���׼ʱ��' is unrecognized or represents more than one time zone.

    介绍 再使用spring操作mysql数据库报错 @Test public void test() { try { //创建连接池,先使用spring框架内置的连接池 DriverManagerDat ...

  4. 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. 今天有Mys ...

  5. java.sql.SQLException: The server time zone value '�й���׼ʱ��' is unrecognized or represents more than one time zone.

    java.sql.SQLException: The server time zone value '�й���׼ʱ��' is unrecognized or represents more tha ...

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

    java.sql.SQLException: The server time zone value '�й���׼ʱ��' is unrecognized or represents more tha ...

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

    SpringBoot运行报错——java.sql.SQLException: The server time zone value '�й���׼ʱ��' is unrecognized or rep ...

  8. Javaweb项目中出现java.sql.SQLException: The server time zone value '�й���׼ʱ��' is unrecognized or represents more than one time zone.异常

    javaweb项目中java.sql.SQLException: The server time zone value '�й���׼ʱ��' is unrecognized or represent ...

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

随机推荐

  1. JS获得天数差异

    //获得天数差异 function datedifference(sDate1, sDate2) { //sDate1和sDate2是2006-12-18格式 var dateSpan, tempDa ...

  2. ASE19团队项目beta阶段Backend组 scrum6 记录

    本次会议于12月12日,19:30在微软北京西二号楼sky garden召开,持续10分钟. 与会人员:Zhikai Chen, Lihao Ran, Xin Kang 请假人员:Hao Wang 每 ...

  3. (全国多校重现赛一)E-FFF at Valentine

    At Valentine's eve, Shylock and Lucar were enjoying their time as any other couples. Suddenly, LSH, ...

  4. Java并发编程系列-(5) Java并发容器

    5 并发容器 5.1 Hashtable.HashMap.TreeMap.HashSet.LinkedHashMap 在介绍并发容器之前,先分析下普通的容器,以及相应的实现,方便后续的对比. Hash ...

  5. USB视频采集系统 视频测试软件将正式发布(方便调试测试各自摄像头,RAW,RGB,YUV)

    先上图,看看这个软件,学习fpga将近一年,了解视频图像开发方向也半年有余,不断学习不断总结,开发软件工具是为了更方便的学习新通信 主要相关知识: FPGA+SDRAM+VGA(双端口fifo技术) ...

  6. linux-export

    使自定义普通变量转换为环境变量: 1. env查看环境变量 2. 设置临时环境变量,关机重启时不生效. export path=$path:/usr/sbin/ 3. 修改profile文件,关机重启 ...

  7. todo demo

    Todo 功能实现 https://rencoo.github.io/appDemo/todo/index.html ---1.添加事项 ---2.置顶事项 ---3.删除事项 ---4.用时排序 - ...

  8. Java实现数列的排列组合

    定义: 排列:从给定个数的元素中取出指定个数的元素,进行排序 组合:从给定个数的元素中仅取出指定个数的元素,不考虑排序 公式: 从n个元素中取出m个元素进行排序的个数: A(m,n)=n(n-1)(n ...

  9. 201871010119-帖佼佼《面向对象程序设计(java)》第十五周学习总结

    博文正文开头格式:(2分) 项目 内容 这个作业属于哪个课程 https://www.cnblogs.com/nwnu-daizh/ 这个作业的要求在哪里 https://www.cnblogs.co ...

  10. 2019年Spring Boot面试都问了什么?快看看这22道面试题!

    Spring Boot 面试题 1.什么是 Spring Boot? 2.Spring Boot 有哪些优点? 3.什么是 JavaConfig? 4.如何重新加载 Spring Boot 上的更改, ...