IDE连MySQL:Server returns invalid timezone. Go to ‘Advanced‘ tab and set ‘serverTimezone‘ property
2020-07-11 14:58
197 查看
报错页面
出现该问题的原因是MySQL驱动jar中的默认时区是UTC。
UTC代表的是全球标准时间 ,但是我们使用的时间是北京时区也就是东八区,领先UTC八个小时。
因为时区不一致,服务器返回了无效的时区。
临时解决方法
1. 去Advanced中找到serverTimezone,更改为Asia/Shanghai
2. 点击apply,重新Test Connection
注意 :下次链接需要再次修改serverTimezone,所以为临时修改
设置MySQL的时区
1. 进入命令窗口(Win + R),连接数据库 mysql -uroot -p
,回车,输入密码
2. 继续输入 show variables like'%time_zone';
3. 设置MySQL的时区,输入set global time_zone = '+8:00';
回车
4. 重新打开命令窗口,链接数据库,查看此时MySQL的时区
5. 此时再去重新Test Connection,便成功了。
相关文章推荐
- 解决Server returns invalid timezone. Go to ‘Advanced‘ tab and set ‘serverTimezone‘ prope后还会报500错的方法
- 使用Pycharm关联MySQL时报错 Server returns invalid timezone. Go to 'Advanced' tab and set 'serverTimezon'
- idea关联 mysql 时报错 Server returns invalid timezone. Go to 'Advanced' tab and set 'serverTimezon'
- Pycharm 连接 MySQL数据库:Server returns invalid timezone. Go to ‘Advanced‘ tab and set ‘serverTime....
- 使用xampp出现:关联mysql失败_Server returns invalid timezone. Go to 'Advanced' tab and set 'serverTimezon'
- Mybatis踩坑记录-Server returns invalid timezone. Go to Advanced tab and set serverTimezone property
- Server returns invalid timezone. Go to 'Advanced' tab and set 'serverTimezone' property manually. .
- Server returns invalid timezone. Go to 'Advanced' tab and set 'serverTimezon'
- 连接mysql数据库发生的错误! Server returns invalid timezone. Go to 'Advanced' tab and set 'serverTimezon'
- 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失败,解决MySQL时区问题:Server returns invalid timezone.Go to 'Advanced' tab and set 'serverTimezone'
- 解决IDEA连接mysql时出现Server returns invalid timezone问题一劳永逸的方法
- 连接数据库报错returns invalid timezone. Go to 'Advanced' tab and set 'serverTimezone' property manually.
- IDEA连接mysql报错Server returns invalid timezone. Go to ‘Advanced‘ tab and set ‘serverTimezone‘ prope解决
- 解决:used by: com.mysql.cj.exceptions.InvalidConnectionAttributeException: The server time zone valu
- Caused by: com.mysql.cj.core.exceptions.InvalidConnectionAttributeException: The server time zone
- 连接池C3P0连接MySQL 8 问题: 'serverTimezone' is not writable or has an invalid setter method
- com.mysql.cj.core.exceptions.InvalidConnectionAttributeException: The server time zone value '���
- Caused by: com.mysql.cj.exceptions.InvalidConnectionAttributeException: The server time zone value '