博客
关于我
MySQL Server has gone away报错原因汇总版
阅读量:61 次
发布时间:2019-02-25

本文共 1257 字,大约阅读时间需要 4 分钟。

MySQL Server has gone away ??????????????????????????

1. MySQL ???????

??????? MySQL ?????????

  • ???????????????MySQL??????
    mysql -uroot -p -e "SHOW GLOBAL STATUS LIKE 'uptime'"

    ????? uptime ???????MySQL???????????????????

  • ????????MySQL??????????????????
    tail /var/log/mysql/error.log

    ???????????MySQL????????

2. ?????

????????????????????????MySQL server has gone away ???

  • ???????MySQL???????????????
    mysql -uroot -p -e "SHOW GLOBAL VARIABLES LIKE '%timeout%;'"

    ?????

    • connect_timeout: 30?
    • interactive_timeout: 28800?
    • wait_timeout: 28800?
    • innodb_lock_wait_timeout: 50?
  • ???????
    mysql -uroot -p -e "SET SESSION wait_timeout=5; SELECT NOW()"

    ??????????????????

3. ??? server ? kill

????????? server ??? kill ????????????

  • ??????????? kill ????
    mysql -uroot -p -e "SHOW GLOBAL STATUS LIKE 'com_kill'"

    ?? com_kill ??? 0?????????? kill?

4. SQL ???????

? SQL ?????????? max_allowed_packet ??????????

  • ??????? max_allowed_packet ???
    mysql -uroot -p -e "SHOW GLOBAL VARIABLES LIKE 'max_allowed_packet'"

    ??????????????????

    mysql -uroot -p -e "SET GLOBAL max_allowed_packet=16777216;"

    ?????????????????????

5. ??????

???????????????????

  • ????????? pinging MySQL ???????????????????????

??

MySQL Server has gone away ?????????????????? kill ? SQL ???????????????????????????

转载地址:http://oil.baihongyu.com/

你可能感兴趣的文章
Python:datetime tzinfo 时区名称文档
查看>>
Python:deepcopy(list) vs new_list = old_list[:]
查看>>
Python:Google API - 从消息中获取 mimeTypes
查看>>
Python:Google API - 从消息中获取 mimeTypes
查看>>
Python:subprocess.call,stdout to file,stderr to file,在屏幕上实时显示stderr
查看>>
Python:TypeError:无法连接“str“和“int“对象
查看>>
Python:XPath 在 ElementTree 中不可用
查看>>
Python:从 FTP 服务器下载文件
查看>>
python:从列表中创建元组列表
查看>>
Python:从嵌套列表中删除重复项
查看>>
Python:从间隔映射到值
查看>>
Python:使用 shell=False 的子进程调用不起作用
查看>>
Python:修改 PATH 环境变量的平台无关方式
查看>>
Python:假与 0
查看>>
Python:函数使用
查看>>
Python:函数进阶
查看>>
Python:在整数的二进制表示中查找最长的二进制间隙
查看>>
Python:如何从二进制转换为 base 64 并返回?
查看>>
Python:如何以非阻塞方式读取子进程的标准输出
查看>>
Python:如何使用 plotly 制作阴影区域或交替背景颜色?
查看>>