首页 > 数据库技术 > 详细

解决springboot项目启动时提示mysql时区无法识别的问题

时间:2019-02-11 18:25:55      阅读:350      评论:0      收藏:0      [点我收藏+]

 

springboot mysql数据库操作实例

启动项目时,出现如下报错:

The server time zone value ‘?D1ú±ê×?ê±??‘ is unrecognized or represents more than one time zone. 

 

解决方案:

使用root用户后台登录mysql数据库:

>mysql -u root -p
Enter password: *********
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 2109
Server version: 5.7.22-log MySQL Community Server (GPL)

Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type ‘help;‘ or ‘\h‘ for help. Type ‘\c‘ to clear the current input statement.

mysql> show variables like ‘%time_zone%‘;

技术分享图片

mysql> set global time_zone=‘+8:00‘;

技术分享图片

退出后,重新登录数据库查询时区,即更正成功。

重启springboot项目后,启动成功。

登录数据库,查询创建的实体表person。

技术分享图片

person表创建成功。

查看person表结构:

技术分享图片

 

解决springboot项目启动时提示mysql时区无法识别的问题

原文:https://www.cnblogs.com/staring0815/p/10362525.html

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