MySQL报错“The server time zone value '�й���׼ʱ��' is unrecognized”

“The server time zone value '�й���׼ʱ��' is unrecognized or represents more than one time zone. You must configure either the server or JDBC driver (via the 'serverTimezone' configuration property) to use a more specific time zone value if you want to utilize time zone support.”

方法1
修改数据库时区。在cmd命令中进入MySQL输入如下命令即可。
set global time_zone = '+8:00';  ##修改mysql全局时区为北京时间,即我们所在的东8区
set time_zone = '+8:00';  ##修改当前会话时区
flush privileges;

缺点:此方法可以临时解决问题,但是一旦关机或重启mysql服务后下一次又需要重新去设置。


方法2
在MySQL的配置文件my.ini中加入
default-time_zone = '+8:00'

原文地址:https://www.cnblogs.com/live41/p/14331138.html