IDEA连接mysql又报错了 Server returns invalid timezone. Go to ‘Advanced‘ tab and set ‘serverTimezone‘ prope

错误界面

本人在上篇博客已经处理第一部分的问题,已经可以加载驱动jar包了,但是连接测试还是失败Server returns invalid timezone. Go to ‘Advanced’ tab and set ‘serverTimezone’ prope

IDEA连接mysql又报错了 Server returns invalid timezone. Go to ‘Advanced‘ tab and set ‘serverTimezone‘ prope
翻译:服务器返回无效时区。进入“高级”选项卡,手动设置“serverTimezone”属性。

看起来是时区出了问题。时区怎么会出问题?

解决方案

我的问题出在设置mysql的时区。
设置mysql时区。
IDEA连接mysql又报错了 Server returns invalid timezone. Go to ‘Advanced‘ tab and set ‘serverTimezone‘ prope
配置完环境变量,命令窗口直接执行下面的命令(管理员打开)
IDEA连接mysql又报错了 Server returns invalid timezone. Go to ‘Advanced‘ tab and set ‘serverTimezone‘ prope
1.mysql -hlocalhost -uroot -p

IDEA连接mysql又报错了 Server returns invalid timezone. Go to ‘Advanced‘ tab and set ‘serverTimezone‘ prope
2.输入set global time_zone = ‘+8:00’; 注意不要漏掉后面的分号),回车,如图:
IDEA连接mysql又报错了 Server returns invalid timezone. Go to ‘Advanced‘ tab and set ‘serverTimezone‘ prope
设置完成之后,再去idea测试连接。如下图就成功了!
IDEA连接mysql又报错了 Server returns invalid timezone. Go to ‘Advanced‘ tab and set ‘serverTimezone‘ prope

**

补充:

IDEA连接mysql又报错了 Server returns invalid timezone. Go to ‘Advanced‘ tab and set ‘serverTimezone‘ prope

如果,你选的是MySQL,

数据库又是其他版本的,也没关系。

在驱动列表里找到 MySQL ,右边Driver files 里,选择一下你需要的版本,保存就可以了。

**