zoukankan      html  css  js  c++  java
  • idea连接mysql报错Server returns invalid timezone. Go to 'Advanced' tab and set 'serverTimezone' property

    idea连接mysql报错Server returns invalid timezone. Go to 'Advanced' tab and set 'serverTimezone' property

    原因

    时区问题,MySQL驱动默认UTC时区。

    解决方案

    1. 修改时区
    # 设置全局时区 mysql> set global time_zone = '+8:00';
    Query OK, 0 rows affected (0.00 sec) 
    # 设置时区为东八区 mysql> set time_zone = '+8:00'; 
    Query OK, 0 rows affected (0.00 sec) 
    # 刷新权限使设置立即生效 mysql> flush privileges; 
    Query OK, 0 rows affected (0.00 sec)
    mysql> show variables like '%time_zone%';
     +------------------+--------+
     | Variable_name | Value |
     +------------------+--------+
     | system_time_zone | EST |
     | time_zone | +08:00 | 
     +------------------+--------+
     2 rows in set (0.00 sec)
    
    1. 在url后添加:?serverTimezone=GMT%2B8

  • 相关阅读:
    随笔
    我的舅舅
    代码规范
    SpringMVC_乱码问题
    SpringMVC_接受请求及数据回显
    Restful风格
    第六周总结
    SpringMVC_控制器
    SpringMVC_初次使用
    SpringMVC_简介
  • 原文地址:https://www.cnblogs.com/fengxiaoqi/p/12897982.html
Copyright © 2011-2022 走看看