在进行mybatis连接数据库进行操作时,报以下错误;

The driver has not received any packets from the server.
MySQL服务器默认的“wait_timeout”是28800秒即8小时,
意味着如果一个连接的空闲时间超过8个小时,MySQL将自动断开该连接,
而连接池却认为该连接还是有效的(因为并未校验连接的有效性),
当应用申请使用该连接时,就会导致上面的报错。

解决方案如下:

Linux系统:

修改MySQL的参数,wait_timeout最大为31536000即1年,在my.cnf中加入:
[mysqld]
wait_timeout=31536000
interactive_timeout=31536000

windows:

没有找到my.ini,我的电脑是重启了之后才连接不上的,于是我去查找了mysql服务,结果也找不到,接着我去修改了mysql安装:

在这里勾选跟随系统启动,这样就不会出现连接不上的问题了,对于网络上提出的连接超时不存在的,因为我是重启了系统的,本应该连接也重新计算,所以希望你们不要踩这个坑。

The driver has not received any packets from the server.相关推荐

  1. The driver has not received any packets from the server,java.net.ConnectException: Connection refuse

    文章目录 问题一.idea中db navigator插件 The driver has not received any packets from the server或者是database对话框ja ...

  2. Mysql连接datagrip 报错 :The driver has not received any packets from the server.

    Communications link failure The last packet sent successfully to the server was 0 milliseconds ago. ...

  3. The driver has not received any packets from the server.(linux中关于mysql相关命令)

    原因: 1.呃呃.重启服务器,没有重新启动mysql; 2.如果还不能连接可能是3306是不允许进行远程连接的,所以在防火墙中设置3306开启远程服务: /sbin/iptables -I INPUT ...

  4. 错误:The driver has not received any packets from the server.

    错误:The driver has not received any packets from the server. 用 mysql 8.*的依赖去连接 mysql 5 时报错 用 mysql 8. ...

  5. 遇到的问题:The driver has not received any packets from the server

    今天新拉了一个项目,点击是碰到数据库的错误, Communications link failure The driver has not received any packets from the ...

  6. The driver has not received any packets from the server

    解决方法: jdbc的url添加参数: jdbc.url=jdbc:mysql://localhost:3306/totosea?useUnicode=true&characterEncodi ...

  7. 连接mysql时报错:The driver has not received any packets from the server.

    连接mysql时报错. 前几天可以打开的数据库也不能打开,报java.net.ConnectException: Connection refused: connect.错误. 报错原因:mysql服 ...

  8. The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received

    tomcat服务启动链接mysql报错: com.mysql.cj.jdbc.exceptions.CommunicationsException: Communications link failu ...

  9. Received status code 403 from server: ForbiddenDisable Gradle ‘offline mode‘ and sync project

    Could not HEAD 'https://dl.bintray.com/umsdk/release/cn/rongcloud/sdk/im_lib/4.0.3.15/im_lib-4.0.3.1 ...

最新文章

  1. Oracle数据库中有关记录个数的查询
  2. 【数据结构】栈的压入、弹出序列
  3. 魔兽世界---屠夫(Just a Hook)
  4. html5css3js文件作业,HTML5 CSS3 JavaScriptWeb前端开发自测试卷2.docx
  5. python维度变换_Python NumPy用法
  6. 如何通过link_to传递一个post请求
  7. 康华光电子技术基础第六版习题答案
  8. 【转载】北京三险一金计算器
  9. 电动车电池bms电池管理系统 锂电池算法SOC代码 获取锂电池SOC采用的是电流积分法,电化学阻抗法
  10. 脚本之家去广告JS插件
  11. Mac下载软件的网站
  12. Python实现的无法拒绝的情人节表白代码,python情人节表白代码
  13. 什么是4:4:4、4:2:2、4:2:0?了解图像压缩取样的方式
  14. windows 空会话 ipc$域控 SYSVOL 和NETLOGON共享
  15. micro-app-vue2 vue3 超详细快速入门指南 学习记录
  16. 快速接入腾讯TUIKaraoke在线 K 歌场景
  17. [转载]关于如何选择5D2和6D的忠告
  18. 计算机专业开题报告论证记录如何写,开题论证记录
  19. Codeforces 1334 C. Circle of Monsters
  20. 基于汇编和C语言STM32流水灯依次闪烁

热门文章

  1. Python---序列化的模块pickle(标准模块)
  2. PAT甲级1157 Anniversary
  3. 互联网舆情数据信息挖掘分析的方法
  4. 驱动开发(四)——点灯大师
  5. SurveyKing-一键搭建比问卷星更强大的企业级调查问卷系统
  6. 大数据计算模式:批处理流处理
  7. 充分利用Microsoft白板的6种方法
  8. 2010年4月微软最有价值专家(MVP)的名单:
  9. 泛微E9联动历史流程明细数据(配置实现)
  10. 讲讲康德的先验要素论