错误提示信息: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';

相关文章:

  • 2021-07-28
  • 2021-04-24
  • 2021-04-14
  • 2021-03-31
  • 2022-12-23
  • 2021-12-08
  • 2021-12-27
  • 2021-10-11
猜你喜欢
  • 2021-09-25
  • 2021-06-01
  • 2022-12-23
  • 2021-04-16
  • 2022-01-18
  • 2021-07-06
相关资源
相似解决方案