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

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

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

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

在mysql命令窗口下输入:

show variables like ‘%time_zone’;

 

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

set global time_zone = '+8:00';

posted @ 2020-01-16 10:07  Eric-Lee  阅读(2995)  评论(0编辑  收藏  举报