IDEA连接MySQL失败:Server returns invalid timezone. Go to Advanced tab and set serverTimezon

一、错误情况

IDEA连接MySQL失败:Server returns invalid timezone. Go to Advanced tab and set serverTimezon

二、错误原因

MySQL未正确设置时区。

三、解决方法

(一)进入MySQL根目录命令行

IDEA连接MySQL失败:Server returns invalid timezone. Go to Advanced tab and set serverTimezon

(二)登录数据库

IDEA连接MySQL失败:Server returns invalid timezone. Go to Advanced tab and set serverTimezon

(三)输入set global time_zone='+8:00';

IDEA连接MySQL失败:Server returns invalid timezone. Go to Advanced tab and set serverTimezon

四、再次连接测试

再次连接数据库即可成功。

IDEA连接MySQL失败:Server returns invalid timezone. Go to Advanced tab and set serverTimezon