mysql数据库时区错误两个解决方法
时间:2019-01-09 | 作者:互联网 | 阅读:242mysql数据库时区错误怎么办?有时候在安装数据的时候,没有设置时区或者设置的时区不对,会造成mysql数据库时区错误,下面由心愿小编为你带来mysql数据库时区错误两个解决方法
springboot情况下,用demo查询数据库中数据,导致报错。
配置如下:
spring:
datasource:
url: jdbc:mysql://localhost:3306/springbootdemo?useUnicode=true&characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull
username: root
password: 123456
driver-class-name: com.mysql.cj.jdbc.Driver
错误如下:
The server time zone value 'ÖD1ú±ê׼걼ä' is unrecognized or represents more than one
原因是:在安装数据的时候,没有设置时区或者设置的时区不对,
解决方法:
方法一:
修改配置,配置如下:
spring:
datasource:
url: jdbc:mysql://localhost:3306/springbootdemo?serverTimezone=GMT%2B8&useUnicode=true&characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull
username: root
password: 123456
driver-class-name: com.mysql.cj.jdbc.Driver
方法二:把数据库的时区重新设置一下
福利游戏
相关文章
更多-
- linux磁盘空间不足怎么办?linux磁盘清理方法
- 时间:2017-06-19
-
- 行政管理文员实习周记
- 时间:2017-06-05
-
- 行政管理文员实习周记5篇
- 时间:2017-06-05
-
- linux下串口调试工具xgcom安装
- 时间:2017-06-03
-
- linux中rsync异步服务器实现文件同步与备份
- 时间:2017-06-03
-
- 钢筋混凝土实训总结
- 时间:1970-01-01
-
- 混凝土公司实习报告
- 时间:1970-01-01
-
- 混凝土搅拌站实习报告
- 时间:1970-01-01
精选合集
更多大家都在玩
大家都在看
更多-
- 《下一站江湖2》5月17日更新内容介绍
- 时间:2024-05-18
-
- 《下一站江湖2》刀法秘籍位置总览
- 时间:2024-05-18
-
- 《下一站江湖2》枪法武学获得方法
- 时间:2024-05-18
-
- 《狗酿酒师》成就列表一览
- 时间:2024-05-18
-
- 《夜族崛起》邪恶技能效果介绍
- 时间:2024-05-18
-
- 《夜族崛起》镰刀技能效果介绍
- 时间:2024-05-18
-
- 《夜族崛起》长弓技能介绍
- 时间:2024-05-18
-
- 《道衍诀》声望与灵石获取方法
- 时间:2024-05-18