JDBC报错:The server time zone value '�й���׼ʱ��' is unrecognized or represents more than one time zone.

JDBC连接数据库时因时区报错,还有8.018连接包有cj包(com.mysql.cj.jdbc.Driver)
方法1:
连接数据库报错,在配置文件中的url后面加上?serverTimezone-UTC?serverTimezone=GMT%2B8
在这里插入图片描述

方法2:打开所用的数据库
输入下面的命令:
set global time_zone=’+8:00’;
在这里插入图片描述

发布了71 篇原创文章 · 获赞 10 · 访问量 3408

猜你喜欢

转载自blog.csdn.net/JH39456194/article/details/104193371