java.sql.SQLException: The server time zone value 'xxx' is unrecognized or represents more than one

java.sql.SQLException: The server time zone value 'xxx' is unrecognized or represents more than one time zone.

时区不对,因为mysql-connection-java版本导致时区的问题。

解决方式:

不加版本号或者版本号为6以上,解决方式:在连接数据库的配置文件中加上以下,时区亚洲/上海,添加代码&serverTimezone=Asia/Shanghai

如下:jdbc:mysql://localhost:3306/renren_fast?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai

java.sql.SQLException: The server time zone value 'xxx' is unrecognized or represents more than one