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
精选合集
更多大家都在玩
大家都在看
更多-
- Bitget Wallet登录难题?一招解决!
- 时间:2025-05-24
-
- 全球首搭NORDIC 54芯片!雷柏VT7二代系列鼠标图赏
- 时间:2025-05-24
-
- 失业金怎么领取 失业金线上线下领取方式对比
- 时间:2025-05-24
-
- 铁威马发布全国产备份套装:24核处理器 容量可达288TB
- 时间:2025-05-24
-
- 波场怎么样
- 时间:2025-05-24
-
- 55寸电视长宽多少厘米 55寸电视厘米尺寸详解
- 时间:2025-05-24
-
- LEO根本卖不掉吗
- 时间:2025-05-24
-
- 怎么查看自己的电子邮件 快速查找个人电子邮件地址的方法
- 时间:2025-05-24