错误提示信息:Server returns invalid timezone. Go to 'Advanced' tab and set 'serverTimezon'。

出现该问题的原因是MySQL驱动jar中的默认时区是UTC。

UTC代表的是全球标准时间 ,但是我们使用的时区是东八区,领先UTC八个小时。

在mysql命令窗口下输入:

show variables like ‘%time_zone’;

IDEA连接mysql数据库发生的错误! Server returns invalid timezone. Go to 'Advanced' tab and set 'serverTimezon'

 

 如果红色区域是SYSTEM,就需要执行:

set global time_zone = '+8:00';

相关文章: