Error: The server time zone value 'Öйú±ê׼ʱ¼ä' is unrecognized or represents more than one time zone.
1 我的配置
datasource:
driver-class-name: com.mysql.cj.jdbc.Driver
type: com.alibaba.druid.pool.DruidDataSource
url: jdbc:mysql://localhost:3306/db_cloud?characterEncoding=utf8&useSSL=false&rewriteBatchedStatements=true&allowPublicKeyRetrieval=true&serverTimeZone=GMT%2B8
username: root
password: root
# serverTimeZone=GMT%2B8 或 serverTimezone=Asia/Shanghai
# 两种均可
尝试了很多方法,删掉serverTimeZone
也不行,修改成serverTimezone=Asia/Shanghai
也不行,最后下面方法成功,并且两种时区设置不影响。
2 我的解决办法
进入到mysql控制台,输入下面的命令
select now();
show variables like '%time_zone%';
set global time_zone = '+8:00';
flush privileges;