首页 > 编程语言 > 详细

springboot权限管理项目遇到的问题记录

时间:2019-12-09 22:28:21      阅读:149      评论:0      收藏:0      [点我收藏+]

1.报MySQL版本的问题

{
  "timestamp": "2019-12-09T14:04:19.605+0000",
  "status": 500,
  "error": "Internal Server Error",
  "message": "nested exception is org.apache.ibatis.exceptions.PersistenceException: \r\n### Error querying database.  Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested exception is 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.\r\n### The error may exist in file [D:\\WorkSpace\\StudioWorkSpace\\mango\\target\\classes\\com\\louis\\mango\\sqlmap\\SysUserMapper.xml]\r\n### The error may involve com.louis.mango.dao.SysUserMapper.findAllUser\r\n### The error occurred while executing a query\r\n### Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested exception is 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.",
  "path": "/user/findAll"
}

  解决方法:修改application.properties文件中的MySQL连接

spring.datasource.driverClassName=com.mysql.jdbc.Driver
#写成下面的写法,则会报错
#spring.datasource.url=jdbc:mysql://localhost:3306/privilege?characterEncoding=utf-8&allowMultiQueries=true
#需修改成如下的版本格式,才不会报错
spring.datasource.url=jdbc:mysql://localhost:3306/privilege?useUnicode=true&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=UTC
spring.datasource.username=root
spring.datasource.password=123456

  

springboot权限管理项目遇到的问题记录

原文:https://www.cnblogs.com/qianshouxiuluo/p/12013757.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!