在win7下安装mysql,每次启动服务,开发环境连接后总是出现时区错误问题,提示错误如下:
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.
解决方法如下:
找到mysql的安装目录下的my.ini文件,使用notepad++打开,在mysqld下加入如下代码:
default-time-zone='+08:00'
之后重启mysql即可;