想必很多初学者都会遇到这个问题

其实很简单.mysql有个机制,就是8小时无通信,myslq就会自动关闭数据;

解决方案(2选1):

或者:

1.定时去做一个查询,就是 select * from XXX;

或者:

2.修改配置文件:

wait_timeout=31536000
interactive_timeout=31536000

其实这个问题.我是很早就注意了,,不过这次因为对数据库有多个连接,所有调试信息打印的这个,确实是8小时无消息.教训啊!!

Connection lost: The server closed the connection的更多相关文章

  1. amqp server closed the connection. check login credentials socket closed

    rabbit, [ {default_user, <<"guest">>}, {default_pass, <<"guest" ...

  2. FTP response 421 received. Server closed connection

    现象: 在springboot的定时器轮询去下载ftp文件时,报以下错误: org.apache.commons.net.ftp.FTPConnectionClosedException: FTP r ...

  3. AMQP server localhost:5672 closed the connection. Check login credentials: Socket closed

    2016-04-13 09:23:38.755 18850 INFO oslo.messaging._drivers.impl_rabbit [req-fafc8542-9403-4b5a-89d2- ...

  4. [杂]SQL Server 之 Understanding Connection Pooling and Transactions

    A SqlConnection consists of two parts: the public instance that your code interacts with (the outer ...

  5. 解决Lost connection to MySQL server during query错误方法

    昨天使用Navicat for MySQL导入MySQL数据库的时候,出现了一个严重的错误,Lost connection to MySQL server during query,字面意思就是在查询 ...

  6. Bind 远程连接DNS服务器时出现 rndc: connection to remote host closed

    使用命令:rndc -s 192.168.1.2 status 连接远程的bind 搭建的DNS服务器时出现下面的错误:   rndc: connection to remote host close ...

  7. 解决Lost connection to MySQL server during query错误方法/Mysql关闭严格模式

    使用Navicat 导入MySQL数据库的时候,出现了一个严重的错误,Lost connection to MySQL server during query,字面意思就是在查询过程中丢失连接到MyS ...

  8. Data source rejected establishment of connection, message from server: "Too many connections"解决办法

    异常名称 //数据源拒绝从服务器建立连接.消息:"连接太多" com.MySQL.jdbc.exceptions.jdbc4.MySQLNonTransientConnection ...

  9. MySQL远程连接丢失问题解决方法Lost connection to MySQL server at ‘reading initial communication packet’, system error: 0

    最近远程连接mysql总是提示 Lost connection 很明显这是连接初始化阶段就丢失了连接的错误 其实问题很简单,都是MySQL的配置文件默认没有为远程连接配置好,只需要更改下MySQL的配 ...

随机推荐

  1. (C#)中的DataSet、string、DataTable等对象转换成Json

    ConvertJson.cs类 using System; using System.Collections.Generic; using System.Text; using System.Data ...

  2. string formating字符串格式化,function函数,group组,recursion递归,练习

    # -*- coding: UTF-8 -*- msg = 'i am {} my hobby is {}'.format('lhf',18) print(msg) msg1 = 'i am %s m ...

  3. python import引入不同路径下的模块

    转载 python 包含子目录中的模块方法比较简单,关键是能够在sys.path里面找到通向模块文件的路径. 下面将具体介绍几种常用情况: (1)主程序与模块程序在同一目录下: 如下面程序结构: `- ...

  4. 彻底理解js中this的指向,不必硬背

    来自   https://blog.csdn.net/u011088260/article/details/79230661 首先必须要说的是,this的指向在函数定义的时候是确定不了的,只有函数执行 ...

  5. 总结:Java 集合进阶精讲1

    知识点:Java 集合框架图 总结:Java 集合进阶精讲1 总结:Java 集合进阶精讲2-ArrayList 集合进阶1---为集合指定初始容量 集合在Java编程中使用非常广泛,当容器的量变得非 ...

  6. xsy子矩形

    考虑一种解题方法,枚举上下边界L,R, 然后二分答案T,我们要判断的是否存在 \[ \frac{(sum_j - sum_i)}{2 * (R - L + 1 + j - i)} \ge T \] 也 ...

  7. python3笔记<二> List

    python数组申明用方括号:例: Arr = ['python','java','javascript'] 截取其中一段元素:例: Arr = [5,6,7,8,9,10,11,12,13,14,1 ...

  8. [UGUI]圆形Image

    参考链接: http://www.cnblogs.com/leoin2012/p/6425089.html 前面说过Mask组件会影响性能:https://www.cnblogs.com/lyh916 ...

  9. List转Json函数

    public string ObjectToJson<T>(string jsonName, IList<T> IL) { StringBuilder Json = new S ...

  10. IntelliJ IDEA 中创建maven项目

    IDEA作为最好得开发工具之一集成了maven工具,今天记录一下我创建使用idea创建maven项目 1.双击IDEA图标,进入到如下界面,在该页面中,点击箭头所示的“Create New Proje ...