首页 > 数据库技术 > 详细

SpringBoot项目连接MYSQL的时区问题

时间:2019-05-29 13:47:55      阅读:291      评论:0      收藏:0      [点我收藏+]
在启动SpringBoot项目的时候报错: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. 原因是MYSQL时区配置不正确。
打开MYSQL的配置文件my.cnf或者my.ini,在[mysqld]区块追加时区配置:

[mysqld]
default-time_zone=‘+8:00‘

然后重启MYSQL服务即可。

SpringBoot项目连接MYSQL的时区问题

原文:https://blog.51cto.com/xvjunjie/2401982

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