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
精选合集
更多大家都在玩
大家都在看
更多-
- MATIC币 交易平台下载MATIC币交易平台最新官网版
- 时间:2024-04-27
-
- 专业的主流货币交易APP是什么?稳定靠谱比特币交易软件分享
- 时间:2024-04-27
-
- GBCAX(G网)交易所平台信得过吗?
- 时间:2024-04-27
-
- 《剑星》遗忘支线任务攻略
- 时间:2024-04-27
-
- 《原神》悬练山北部热气球宝箱收集位置攻略
- 时间:2024-04-27
-
- 《射雕》天黑不要乱走成就攻略
- 时间:2024-04-27
-
- 《星际公民》导弹发射方法
- 时间:2024-04-27
-
- 《射雕》应是故人来成就攻略
- 时间:2024-04-27