在数据库连接字符后面设置它的时区就好,如: ?serverTimezone=GMT%2B8
serverTimezone=GMT%2B8
参考文章: https://blog.csdn.net/weixin_37577564/article/details/80329775