DataGrip连接数据库报错Server returns invalid timezone. Go to 'Advanced' tab and set 'serverTimezone' proper

问题描述

Server returns invalid timezone. Go to ‘Advanced’ tab and set ‘serverTimezone’ property manually

服务器返回无效时区。进入“高级”选项卡,手动设置“serverTimezone”属性

解决方案

  1. 环境变量Path设好C:\Program Files\MySQL\MySQL Server 5.7\bin;
  2. 命令行mysql -hlocalhost -uroot -p输入密码进入mysql
  3. 查看时区show variables like '%time_zone';
    DataGrip连接数据库报错Server returns invalid timezone. Go to 'Advanced' tab and set 'serverTimezone' proper
  4. 设置时区set global time_zone='+8:00';
    DataGrip连接数据库报错Server returns invalid timezone. Go to 'Advanced' tab and set 'serverTimezone' proper







重新进入MySQL后再查看时区:
DataGrip连接数据库报错Server returns invalid timezone. Go to 'Advanced' tab and set 'serverTimezone' proper

再点Test Connection就成功了
DataGrip连接数据库报错Server returns invalid timezone. Go to 'Advanced' tab and set 'serverTimezone' proper

参考文献

  1. Server returns invalid timezone. Go to Advanced tab and set serverTimezone property manually