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
精选合集
更多大家都在玩
大家都在看
更多-
- 蚂蚁新村今日答案最新5.8
- 时间:2024-05-08
-
- 为什么超市购物小票用指甲划一下就有黑色的印记
- 时间:2024-05-08
-
- 蚂蚁庄园2024年5月9日答案
- 时间:2024-05-08
-
- 2024蚂蚁庄园今日最新答案5.9
- 时间:2024-05-08
-
- 2024今日小鸡最新答案5.9
- 时间:2024-05-08
-
- 小鸡宝宝考考你通常情况下,人最先长出来的牙齿是
- 时间:2024-05-08
-
- 人最先长出的牙齿是
- 时间:2024-05-08
-
- 宇智波斑「在2024年4月的段位赛胜率为56%?
- 时间:2024-05-08