转载自:https://blog.csdn.net/weixin_37577564/article/details/80329775
解决方法:
在jdbc连接的url后面加上serverTimezone=GMT即可解决问题,如果需要使用gmt+8时区,需要写成GMT%2B8
url=jdbc:mysql://localhost:3306/heart?useUnicode=true&characterEncoding=utf8&serverTimezone=GMT%2B8&useSSL=false