一、报错提示:

二、报错原因:

原因一:

一种可能是发送的 SQL 语句太长,以致超过了 max_allowed_packet 的大小,如果是这种原因,你只要修改 my.cnf,加大 max_allowed_packet 的值即可。

原因二:
一开始某些SQL执行成功,但是后面的SQL执行失败报错gone away,大部分原因就是这个连接被闲置超过了wait_timeout,mysql服务器单方面断掉了这个连接。

三、解决办法:

修改 my.cnf 配置,添加以下配置

mysql]# cat conf/docker.cnf
....
#增加超时时间
wait_timeout=28800
interactive_timeout=28800
max_allowed_packet = 10M #增加传输大小

四、重启服务

 docker restart 容器名称/id

mysql报错:MySQL server has gone away的更多相关文章

  1. 连接mysql报错 : The server time zone value 'Öйú±ê׼ʱ¼ä' is unrecognized or represents more than one time zone...

    time zone 时区错误 DBEAVER连接MySQL运行报错The server time zone value 'Öйú±ê׼ʱ¼ä' is unrecognized or repres ...

  2. 解决MySQL报错The server time zone value 'Öйú±ê׼ʱ¼ä' is unrecognized or represents .....

    1.前言 今天在用SpringBoot2.0+MyBatis+MySQL搭建项目开发环境的时候启动项目发现报了一个很奇怪的错,报错内容如下: java.sql.SQLException: The se ...

  3. Spring Boot连接MySQL报错“Internal Server Error”的解决办法

    报错信息如下: {timestamp: "2018-06-14T03:48:23.436+0000", status: 500, error: "Internal Ser ...

  4. SpringBoot------连接MySQL报错:The server time zone value 'Öйú±ê׼ʱ¼ä' is unrecognized

    报错提示: The server time zone value 'Öйú±ê׼ʱ¼ä' is unrecognized or represents more than one time zon ...

  5. MySQL 报错MySQL server syntax to use near 'OPTION SQL_SELECT_LIMIT=DEFAULT'

    在hive的应用中,出现如下错误时You have an error in your SQL syntax; check the manual that corresponds to your MyS ...

  6. lnmp下启动mysql报错 The server quit without updating PID file

    启动时候错误代码:Starting MySQL[FAIL.] The server quit without updating PID file (/var/run/mysqld/mysqld.pid ...

  7. 连接MySQL报错The server time zone value 'Öйú±ê׼ʱ¼ä' is unrecognized or represents more than one time zone.

    MySQL time zone 时区错误 使用root用户登陆执行命令: ---> show variables like '%time_zone%'; 默认值system为美国时间:如下图: ...

  8. MySQL报错The server time zone value 'Öйú±ê׼ʱ¼ä' is unrecognized or represents

    参考资料:https://blog.csdn.net/qq_37630354/article/details/82814330 在property里加上最后这个参数即可

  9. PHP连接MySQL报错:SQLSTATE[HY000] [2002] Can't connect to local MySQL server through socket 'MySQL' (2)

    如下所示,PHP连接MySQL报错: SQLSTATE[HY000] [2002] Can't connect to local MySQL server through socket 'MySQL' ...

  10. Asp.Net连接Mysql报错Out of sync with server

    Asp.Net连接Mysql报错Out of sync with server 原因:程序引用的MySql.Data.dll版本高于服务器版本 解决:下载一个低版本的MySql.Data.dll,项目 ...

随机推荐

  1. 解决ssh连接远程主机出现“REMOTE HOST IDENTIFICATION HAS CHANGED”问题

    Win通过ssh连接远程主机 命令提示符方式 ssh username@ip 此后输入你的密码 通过VSCode Remote-SSH 在VSCode拓展中搜索"Remote-SSH&quo ...

  2. js根据某个字段进行分组

    分组前数据: [ {"f1":"q","f2":"w","f3":"e",&qu ...

  3. python中操控excel的几个库:xlwt,xlrd,xlutils

    一.xlrd和xlwt模块介绍 xlrd模块提供在任何平台上从excel电子表格(.xls和.xlsx)中提取数据的功能,xlwt模块提供生成与Microsoft Excel 95 到2003版本兼容 ...

  4. Python elasticsearch_dsl 报错及解决方法

    Exception:maxClauseCount is set to 1024 原因:报错原因是Search限制一个bool查询中最多只能有1024个值或子查询,当超过1024时,会抛出异常. 解决办 ...

  5. '大龄‘后端程序员,快速捡起ECMAScript6

    1.Promise 2.迭代器 3.async 4.module 5. this的理解

  6. 四大组件之内容提容者ContentProvider

    参考:Android开发基础之内容提容者ContentProvider Android四大组件 内容提供者是四大组件之一,还记得Android的四大组件吗? 前面我们学习了三大组件了,对吧! 其中有: ...

  7. sql两种表联查更新的方法

    1.update ceshi c1,ceshi2 c2 set c1.num=c2.aa where c1.id=c2.cid; 2.update ceshi c1 INNER JOIN ceshi2 ...

  8. 04_Linux完全卸载安装Mysql

    1.Linux环境完全卸载mysql相关文件: 完全卸载mysql相关文件:             yum remove mysql mysql-server mysql-libs compat-m ...

  9. Nginx基础篇(一)

    (一)介绍 Nginx 是开源.高性能.高可靠的 Web 和反向代理服务器,也可以作为邮件代理服务器.而且支持热部署,即几乎可以做到 7 * 24 小时不间断运行,即使运行几个月也不需要重新启动,还能 ...

  10. 2015 for Mac PDF编辑软件

    ​ 开始前请先断开网络连接,断网,断网,断网! 开始前请先断开网络连接,断网,断网,断网! 开始前请先断开网络连接,断网,断网,断网! ​编辑 1.软件下载完成后,打开软件包如上图五个文件(第1个是安 ...