当前位置: 首页 > news >正文

The last packet sent successfully to the server was 0 milliseconds ago. 解决办法

mybatis-generator-maven-plugin插件

  • 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 zone value if you want to utilize time zone support.
  • 成功解决

使用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
在这里插入图片描述

成功解决

在这里插入图片描述

http://www.lryc.cn/news/506.html

相关文章:

  • 分布式高级篇1 —— 全文检索
  • 集成电路开发及应用-模拟数字部分专栏目录
  • ios使用SARUnArchiveANY 解压rar文件(oc和swift版本)
  • 【Python学习笔记】21.Python3 函数(2)
  • day57回文子串_最长回文子序列
  • Element UI框架学习篇(二)
  • 【C++】类与对象(上)
  • Leetcode.1797 设计一个验证系统
  • Kaldi - 数据文件准备
  • 91.【SpringBoot-03】
  • 【本地项目】上传到【GitLab】流程详解
  • 初阶指针C
  • 云原生安全2.X 进化论系列|揭秘云原生安全2.X的五大特征
  • json文件在faster_rcnn中从测试到训练 可行性
  • golang 1.20正式发布,更好更易更强
  • 图片显示一半怎么回事?
  • 102-并发编程详解(中篇)
  • jsp羽毛球场馆管理系统Myeclipse开发mysql数据库web结构java编程计算机网页项目
  • CacheLib 原理说明
  • 【dapr】服务调用(Service Invokation) - app id的解析
  • Odoo丨5步轻松实现在Odoo中打开企微会话框
  • python读取.stl文件
  • vue2.0项目第一部分
  • 锁与原子操作
  • Prometheus Pushgetway讲解与实战操作
  • 常见字符串函数的使用,你确定不进来看看吗?
  • Elasticsearch:在搜索中使用衰减函数(Gauss)
  • 微信小程序 Springboot英语在线学习助手系统 uniapp
  • LeetCode算法题解——双指针2
  • 线性杂双功能peg化试剂——HS-PEG-COOH,Thiol-PEG-Acid