time zone value is unrecognized - MySQL异常提示

[已解决]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.

如果jdbc驱动为8.0.11版本,在url后面追加serverTimezone参数。

<dependency>
    <groupId>mysql</groupId>
    <artifactId>mysql-connector-java</artifactId>
    <version>8.0.11</version>
</dependency>

serverTimezone=UTC

jdbc:mysql://${db.url}/demo?serverTimezone=UTC

或者

采用低版本mysql jdbc驱动:

<dependency>
    <groupId>mysql</groupId>
    <artifactId>mysql-connector-java</artifactId>
    <version>5.1.28</version>
</dependency>

或者

修改mysql server配置文件my.ini

default-time-zone='+08:00'