码迷,mamicode.com
首页 > 数据库 > 详细

mysql的时区错误问题,The server time zone value 'Öйú±ê׼ʱ¼ä' is unrecognized or represents more than one

时间:2019-01-27 16:44:51      阅读:327      评论:0      收藏:0      [点我收藏+]

标签:bat   cannot   connect   col   使用   user   问题   info   iss   

在使用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 ‘?D1ú±ê×?ê±??‘ 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‘

 

技术分享图片

 

然后就可以正常访问了

mysql的时区错误问题,The server time zone value 'Öйú±ê׼ʱ¼ä' is unrecognized or represents more than one

标签:bat   cannot   connect   col   使用   user   问题   info   iss   

原文地址:https://www.cnblogs.com/xiufengchen/p/10326331.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!