原因是,你的application.properties里面的url末尾少写了
serverTimezone=GMT%2B8
比如我的Url原本是这样的:
spring.datasource.url=jdbc:mysql://localhost:3306/hero?useUnicode=true&characterEncoding=utf8&useSSL=false
再末尾加上
&serverTimezone=GMT%2B8
变成
spring.datasource.url=jdbc:mysql://localhost:3306/hero?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=GMT%2B8