IDEA 连接数据库MYSQL 报错:Server returns invalid timezone. Go to 'Advanced' tab and set 'serverTimezone' property manually.
解决办法1:
在配置文件 配置数据库的信息 后面加上 serverTimezone=GMT 例如:
url: jdbc:mysql://localhost:3306/db01?useUnicode=true&characterEncoding=utf-8&serverTimezone=GMT
解决办法2:
1、打开 cmd 窗口 输入 :mysql -hlocalhost -uroot -p
2、输入数据库密码
3、输入 show variables like '%time_zone'; (分号不能忘记)
若:system_time_zonetime_zone 值为 SYSTEM 则没有修改时区
4、输入 set global time_zone ='+8:00';(分号不能忘记)
5、使用IDEA 连接MYSQL 成功!!!!