项目场景:

每一次遇到的Bug就是提升经验和能力的时候。
SpringBoot 每次增加Entity之后,需要Refresh Data Sources,以更新IDE和数据库的链接,当然也可以不更新,如果补鞥更新那么Entity里面的Table的name就会标红线,强迫症使我不得不更新,哈哈哈哈。


问题描述:

IDEA连接mysql,地址,用户名,密码,数据库名,全都配置好了,但是依然报错Server returns invalid timezone. Go to ‘Advanced’ tab and set ‘serverTimezone’ property manually.

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


原因分析:

据百度翻译是这样的意思:
服务器返回无效时区。转到“高级”选项卡并手动设置“serverTimezone”属性。
好了下面直接上解决方法。


解决方案:

进入Windows PowerShell,输入mysql -uroot -p,回车,输入密码,回车,进入数据库。如图:

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

继续输入 show variables like’%time_zone’; (注意不要漏掉后面的分号),回车,如图:
Server returns invalid timezone. Go to ‘Advanced‘ tab and set ‘serverTimezone‘ property manually
如果显示 SYSTEM 就是没有设置时区,那么最后一步设置时区。
输入set global time_zone = ‘+8:00’; 注意不要漏掉后面的分号),回车,如图:
Server returns invalid timezone. Go to ‘Advanced‘ tab and set ‘serverTimezone‘ property manually
好了 搞定收工,下班回家啦!

相关文章: