Today, using Spring-boot to configure MySQL, the startup project throws the following error:
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.
SpringBoot2.1, if you do not specify the MySQL driver version, the driver that it automatically relies on is the very high version of
8.0.12, which is caused by the time zone difference between the database and the system. The problem can be solved by adding
serverTimezone=GMTto the url of the
jdbcconnection. If you need to use the
gmt+8time zone, you need to write it as
GMT%2B8, otherwise it will be parsed as empty.
5.1.28will not have a time zone problem.
serverTimezone=GMT%2B8 after the configuration database URL
Note: Don’t ignore