报错内容为: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 specifc time zone value if you want to utilize time zone support.
错误原因:时区错误
解决办法
方法(1):在bin目录下使用cmd登录mysql(这种方法在重启电脑后就失效了,需要一次次设置,比较麻烦)
输入下列命令
show variables like '%time_zone%';
set global time_zone='+8:00';
关闭窗口再重新打开,如下图所示即设置成功
方法(2):修改MySQL的配置文件my.ini,用记事本打开,在[mysqld]下方添加:
default-time-zone=’+08:00’
保存
接下来重启mysql服务:进入MySQL文件的bin目录,在cmd窗口中输入以下命令:
net stop mysql
net start mysql
最后一步:登录MySQL,输入show variables like ‘%time_zone%’ 命令,出现下图即设置成功