gpt4 book ai didi

php - 服务器发送 mysql 已消失错误

转载 作者:行者123 更新时间:2023-11-29 19:03:45 26 4
gpt4 key购买 nike

我在我的网站中使用 comet.. 长轮询脚本经常返回 “Mysql 已消失” 错误...

我使用了mysqli扩展(面向对象)来连接php和mysql数据库

即使 php *mysqli -> ping()* 方法也无法解决此问题。

最好的部分是我使用这个网站与 comet 的两个月内没有发生错误但现在它发生了......

提示:我将 mysql 数据库的排序规则更改为 utfmb4_unicode_ci,将字符集更改为 utbmb4

我该如何解决这个问题?

最佳答案

您需要在my.cnf中检查以下想法

check that wait_timeout mysql variable in your my.cnf configuration file is large enough.

另请检查ma​​x_allowed_pa​​cket

 set max_allowed_packet = 128M, 

然后重新启动 MySQL 服务器

关于php - 服务器发送 mysql 已消失错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43671663/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com