zoukankan      html  css  js  c++  java
  • mysql的时区错误问题,The server time zone value 'Öйú±ê׼ʱ¼ä' is unrecognized or represents more than one

    在使用springboot整合ssm和druid的时候出现数据库一个问题

    org.springframework.web.util.NestedServletException: Request processing failed; nested exception is org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.exceptions.PersistenceException: 
    ### Error querying database.  Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get JDBC Connection; nested exception is java.sql.SQLException: Connections could not be acquired from the underlying database!
    ### The error may exist in com/wj/mapper/UserMapper.xml
    ### The error may involve com.wj.mapper.UserMapper.selectAllUserInfo
    ### The error occurred while executing a query
    ### Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get JDBC Connection; nested exception is java.sql.SQLException: Connections could not be acquired from the underlying database!
        org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:982)
        org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:872)
        javax.servlet.http.HttpServlet.service(HttpServlet.java:650)
        org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:846)
        javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
    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.
        com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:127)
        com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:95)
        com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:87)
        com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:61)
        com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:71)
        

    出现这个问题时候,就是是数据库时间问题,然后执行了

    SHOW VARIABLES LIKE '%time_zone%'

    进行查询设置:

    SET GLOBAL time_zone='+8:00'

    然后就可以正常访问了

    笔记转移,由于在有道云的笔记转移,写的时间可能有点久,如果有错误的地方,请指正
  • 相关阅读:
    给任意多个链表然后要合并成一个
    hdu5967数学找规律+逆元
    poj2125最小点权覆盖+找一个割集
    poj3308 最小点权覆盖
    poj2987 最大闭合权子图基础题
    poj2699 转化为可行性判定问题+二分枚举+最大流
    判断割是否唯一zoj2587
    快排优化
    jvm垃圾收集器
    三次握手与四次挥手
  • 原文地址:https://www.cnblogs.com/xiufengchen/p/10326331.html
Copyright © 2011-2022 走看看