连接数据库报错java.sql.SQLException: The server time zone value '�й���׼ʱ��' is unrecognized or represents m

开发工具:IDEA
环境:jdk1.8,mysql 8.0.17
问题:springboot项目连接mysql数据库,报异常: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.
解决方式:查看application.properties配置文件
原配置文件如下:
连接数据库报错java.sql.SQLException: The server time zone value '�й���׼ʱ��' is unrecognized or represents m_第1张图片
在url中添加配置
如下图:
连接数据库报错java.sql.SQLException: The server time zone value '�й���׼ʱ��' is unrecognized or represents m_第2张图片
并且一定要确认自己的username和password正确,才可以与数据库进行连接。

你可能感兴趣的:(Springboot,mysql)