The server time zone value 'Öйú±ê׼ʱ¼ä' is unrecognized or represents more than one time zone.
1、问题描述
利用SpringBoot+mybatis开发的时候,访问后出现错误: The server time zone value 'Öйú±ê׼ʱ¼ä' is unrecognized or represents more than one time zone.
mysql版本是8版本
配置如下:
datasource: type: com.alibaba.druid.pool.DruidDataSource # 当前数据源操作类型 driver-class-name: com.mysql.cj.jdbc.Driver # mysql驱动包 url: jdbc:mysql://localhost:3306/cloudDB01 username: root password: root
2、解决方案
更改数据源的url的配置:
url: jdbc:mysql://localhost:3306/cloudDB01?useUnicode=true&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=UTC
每个人都会有一段异常艰难的时光 。
生活的压力 , 工作的失意 , 学业的压力。
爱的惶惶不可终日。
挺过来的 ,人生就会豁然开朗。
挺不过来的 ,时间也会教你 ,怎么与它们握手言和 ,所以不必害怕的。
——杨绛