错误日志:
Error updating database. Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested exception is 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.
报错的配置方式
$spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
$spring.datasource.url=jdbc:mysql://localhost:3306/test
$spring.datasource.username=root
$spring.datasource.password=admin123456
解决方式:
在数据库后加上 ?serverTimezone=GMT%2B8
更改之后的配置方式
$spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
$spring.datasource.url=jdbc:mysql://localhost:3306/test?serverTimezone=GMT%2B8
$spring.datasource.username=root
$spring.datasource.password=admin123456