使用xampp出现:关联mysql失败_Server returns invalid timezone. Go to 'Advanced' tab and set 'serverTimezon'

1.开启xampp服务

使用xampp出现:关联mysql失败_Server returns invalid timezone. Go to 'Advanced' tab and set 'serverTimezon'

如果无法启动请见:https://mp.csdn.net/console/editor/html/104897193

2.修改时区

出现错误原因:

时区错误,MySQL默认的时区是UTC时区,比北京时间晚8个小时。

所以要修改mysql的时长

登录mysql,输入用户名和密码. 命令为:mysql -u 你的账号 -p 你的密码使用xampp出现:关联mysql失败_Server returns invalid timezone. Go to 'Advanced' tab and set 'serverTimezon'

3.如果你出现如下错误:

使用xampp出现:关联mysql失败_Server returns invalid timezone. Go to 'Advanced' tab and set 'serverTimezon'

说明的你xampp下的mysql没有配置到环境变量中。配置xampp下的mysql到环境变量中,

比如我的mysql的bin路径为C:\developer_tools\xampp\mysql\bin

右击我的电脑->系统属性->高级系统设置->高级->系统变量,在path变量后添加” ;C:\developer_tools\xampp\mysql\bin“(不含引号,前面有;号)。

在mysql的命令模式下,输入:set global time_zone='+8:00';

4.测试

用idea连接mysql,点击Test connetion,成功

使用xampp出现:关联mysql失败_Server returns invalid timezone. Go to 'Advanced' tab and set 'serverTimezon'