The last packet sent successfully to the server was 0 milliseconds ago. 解决办法
The last packet sent successfully to the server was 0 milliseconds ago.You must configure either the server or JDBC driver (via the serverTimezone configuration property) to use a more specifc time zo
mybatis-generator-maven-plugin插件
使用mybatis-generator-maven-plugin插件根据generatorConfig.xml文件自动生成dao层和pojo模型代码是报错解决方案
The last packet sent successfully to the server was 0 milliseconds ago

明显是连接不上数据库。。。
我用databases工具试了一下,可以连接上
确定是配置文件generatorConfig.xml的问题
MySQL在高版本需要指明需要进行SSL连接,
(保障Internet数据传输安全利用数据加密)
需要在url后面添加useSSL=true或者false,
useSSL=true 需要连接
useSSL=false 不需要连接
这里,我们改成false
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.
配置了之前的路径后,然后还是报错。。
原因:
我创建的是springboot项目,在pom中添加mysql依赖,并没有设置版本号,因为springboot内部配置过了。它配置的版本号是8.0.13 就是因为mysql的版本太高了,所以才会出现这个报错。
如果你加载mysql比较低的版本,则不会有这种情况了。
解决方法:
在配置文件中的 连接字符串后面加上?serverTimezone=UTC
UTC是统一标准世界时间
完整的连接字符串示例:jdbc:mysql://localhost:3306/hello?serverTimezone=UTC
成功解决

魔乐社区(Modelers.cn) 是一个中立、公益的人工智能社区,提供人工智能工具、模型、数据的托管、展示与应用协同服务,为人工智能开发及爱好者搭建开放的学习交流平台。社区通过理事会方式运作,由全产业链共同建设、共同运营、共同享有,推动国产AI生态繁荣发展。
更多推荐



所有评论(0)