The server time zone value '?й???????' is unrecognized or represents more than one time zone. You...

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 问题

错误原因:

    本人用最新版本的mysql数据库

    使用原mysql5.1.38不会出现该问题,但会提示版本驱动过旧的情况

    使用了Mysql最新版驱动所以报错

    新版驱动名字为 driverClass=“com.mysql.cj.jdbc.Driver”

    解决方案:

    方案1、在项目代码-数据库连接URL后,加上 ?serverTimezone=UTC(注意大小写必须一致)


方案2、在mysql中设置时区,默认为SYSTEM(推荐)

set global time_zone=’+8:00’

mysql> set global time_zone='+8:00';

Query OK, 0 rows affected (0.01 sec)

你可能感兴趣的:(The server time zone value '?й???????' is unrecognized or represents more than one time zone. You...)