项目启动报错:java.sql.SQLException: The server time zone value ‘�й���׼ʱ��‘ is unrecognized or...

作者:
项目启动报错: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 specific time zone value if you want to utilize time zone support.

是数据库时区问题,数据库安装时默认为英语,0:00时区

Windows系统中,XP的时区是GMT,而Win7的时区是UTC。

mysql返回的时间会比实际时间要早8小时。 解决:在url连接字符串后面加上url=jdbc:mysql://127.0.0.1:3306/sporthealth?useUnicode=true&characterEncoding=utf8&useSSL=false**&serverTimezone=UTC**

the end

免责声明:本文内容均来自互联网,但不代表简明教程的观点和立场.

已有 3784 次赞