zoukankan      html  css  js  c++  java
  • java.sql.SQLException: The server time zone value 'Öйú±ê׼ʱ¼ä' is unrecognized...

    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:127)
        at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:95)
        at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:87)
        at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:61)
        at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:71)
        at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:76)
        at com.mysql.cj.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:862)
        at com.mysql.cj.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:444)
        at com.mysql.cj.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:230)
        at com.mysql.cj.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:226)
        at com.alibaba.druid.pool.DruidAbstractDataSource.createPhysicalConnection(DruidAbstractDataSource.java:1558)
        at com.alibaba.druid.pool.DruidAbstractDataSource.createPhysicalConnection(DruidAbstractDataSource.java:1623)
        at com.alibaba.druid.pool.DruidDataSource$CreateConnectionThread.run(DruidDataSource.java:2468)

    这是在使用MySQL 8.0以上版本(MySQL连接驱动和版本都是8.0以上)的时候出现的问题错误,我们需要在访问数据库的Url后面加上以下的语句即可:

    &serverTimezone=GMT%2B8

    url: jdbc:mysql://localhost:3306/jxj_refund?useUnicode=true&characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull&serverTimezone=GMT%2B8
     
  • 相关阅读:
    flex>导航
    flex>图表控件
    Struts2>Cannot find the tag library descriptor for /strutstags
    jsp>Smartupload例子代码
    flex>MXML语法
    解决JBoss只能通过localhost(127.0.0.1)而不能通过IP访问
    jsp>tomcat配置虚拟目录
    JSF>概述
    Struts2>中文乱码
    flex>HttpService
  • 原文地址:https://www.cnblogs.com/bulrush/p/10412409.html
Copyright © 2011-2022 走看看