zoukankan      html  css  js  c++  java
  • 【坑】The server time zone value '�й���׼ʱ��' is unrecognized or represents more than one time zone.

    在使用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

  • 相关阅读:
    linux压缩命令
    常用正则表达式
    java23种设计模式
    程序员
    让程序猿离职的非钱原因
    PHP MVC 中的MODEL层
    CSS样式补充代码
    网页中插入背景音乐
    Window.document对象(2)
    Window.document对象(1)
  • 原文地址:https://www.cnblogs.com/YrZf/p/11896510.html
Copyright © 2011-2022 走看看