心愿游戏:符合你心愿的游戏!

手机版

mysql数据库时区错误两个解决方法

时间:2019-01-09 19:28:12 | 来源:互联网 | 编辑: 互联网 | 阅读:

mysql数据库时区错误怎么办?有时候在安装数据的时候,没有设置时区或者设置的时区不对,会造成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

方法二:把数据库的时区重新设置一下

mysql数据库时区错误两个解决方法_wishdown.com

类似游戏

热游排行

更多

关于我们  下载声明  加入我们  意见反馈  网站地图

本站为非营利性个人网站,本站所有游戏来自于互联网,版权属原著所有。如有侵犯你的版权,请发邮件给wishdown2023@163.com

湘ICP备2021017279号-3 公安部备案号:13092602000101

Copyright©2006-2019 www.wishdown.com All rights reserved