mysql连接异常:The server time zone value '�й���׼ʱ��' is unrecognized or represents more than one time zo

错误信息如下:
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。。。

错误原因:mysql识别时区出现错误,这是因为访问的url中没有指定时区为UTC
出错误的url:

jdbc.url=jdbc:mysql://localhost:3306/seckill?useUnicode=true&characterEncoding=utf8

在后面添加时区的参数数即可:

jdbc.url=jdbc:mysql://localhost:3306/seckill?useUnicode=true&characterEncoding=utf8&serverTimezone=UTC

你可能感兴趣的:(mysql,异常处理,数据库)