1.错误日志如下所示
** java.sql.SQLException: 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:
修改数据库时区:
在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'