mysql connection database error: java.sql.SQLException: The server time zone value

Error message:

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.

The reason for the error: The error caused by the time zone difference between the database and the system.
Solution: Add &serverTimezone=UTC after the jdbc connection url

spring.datasource.url = jdbc:mysql://127.0.0.1:3306/xxx?characterEncoding=utf-8&serverTimezone=UTC

problem solved

Guess you like

Origin blog.csdn.net/noob9527/article/details/90669770