连接MySQL报错The server time zone value 'Öйú±ê׼ʱ¼ä' is unrecognized or represents more than one time zone.

MySQL time zone 时区错误

使用root用户登陆执行命令:

show variables like '%time_zone%';

默认值system为美国时间;如下图: 

因此,只需要将值设置为系统时区 也就是 +8:00 格式

方法一:

执行---> set global time_zone='+8:00';  #修改mysql全局时区为北京时间,即我们所在的东8区

  ---> set time_zone = '+8:00';  #修改当前会话时区

  ---> flush privileges;  #立即生效

 方法二:

修改mysql根目录下的my.ini文件 ,在文件的  [mysql]  节点下加入:default-time-zone='+8:00'

猜你喜欢

转载自www.cnblogs.com/minutes/p/10488004.html