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

报错信息: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 specifc time zone value if you want to utilize time zone support.

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

 

解决方案:

1、尝试了网上说的修改本地mysql的市区,没用

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

 

2、尝试在mysql连接的url地址后面加上 &serverTimezone=Asia/Shanghai,没用

 

后来发现pom文件中mysql-connector-java 对应的版本和我电脑本地安装的mysql版本不一致,将版本修改成我本地安装的版本后重启服务,就可以了