一、报错提示:

二、报错原因:

原因一:

一种可能是发送的 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. CSS 页面整体变灰色

    body {-webkit-filter: grayscale(100%) !important;-moz-filter: grayscale(100%) !important;-ms-filter: ...

  2. Socket.io + Knex 实现私聊聊天室

    前言 本文只介绍实现的核心代码,目的是记录和分享知识.若感兴趣可以往下看,在文章最后贴上了仓库地址.前端使用 Vite + Vue3:后端使用 Knex + Express. Room 的概念 私密 ...

  3. 获取微信小程序列表渲染 index

    微信小程序列表渲染 index(索引值)通过 wx:for-index="index" 来获取: <view class="item" wx:for=&q ...

  4. 脚本之美│VBS 入门交互实战

    目录 什么是 VBS 第一个 VBS 脚本 msgbox 语法 中文乱码 弹窗交互功能 表白恶搞 什么是 VBS VBS 是一种 Windows 脚本语言,全称是 Microsoft Visual B ...

  5. SpringMVC基础源码分析(一)

    实现Controller的三种方式分析 每种实现的方式对应的HanderAdapter都不同. 实现Controller接口 该接口对应的HanderAdapter为SimpleControllerH ...

  6. Landsat数据在USGS中无法下载Surface Reflectance产品的解决方法

      本文介绍在USGS官网下载Landsat遥感影像数据时,出现报错信息,无法下载地表反射率产品(Surface Reflectance)的解决办法.   最近,利用这篇文章批量下载Landsat遥感 ...

  7. SAP SPOOL_INTERNAL_ERROR

    运行SE38程序 RSPO0041

  8. Gameframework之微信小游戏

    Gameframework之微信小游戏 这两天测试了一个Gameframework框架游戏及资源转微信小游戏,在这里记录一下踩过的坑,望避之! 材料: 小游戏Dome用的StarForce项目. 环境 ...

  9. 2022-04-26内部群每日三题-清辉PMP

    1.一家组织的经验教训数据库表明过去的重大项目问题是质量失败.项目经理在制定质量管理过程时决定做得更彻底.为确保质量,项目经理应该怎么做? A.根据项目的范围和需求制定质量管理计划. B.将所有质量控 ...

  10. 第1关—print()函数与转换

    Print()函数的用法有以下几种:单枪匹马--不带引号.搭配单引号.搭配双引号.搭配三引号,我们逐个见识下吧!  1.无引号       注意,这里的括号一定要用[英文括号],不然会报错 impor ...