PDO:MySQL 服务器已经消失 [英] PDO: MySQL server has gone away

查看:30
本文介绍了PDO:MySQL 服务器已经消失的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个每晚都要做大量跑腿工作的脚本.

I have a script that does a lot of legwork nightly.

它使用在循环中执行的 PDO 准备语句.

It uses a PDO prepared statement that executes in a loop.

前几个运行良好,但后来我发现它们都失败并出现错误:MySQL 服务器已经消失".

The first few are running fine, but then I get to a point where they all fail with the error: "MySQL server has gone away".

我们运行 MySQL 5.0.77.

We run MySQL 5.0.77.

PHP 5.2.12 版

PHP Version 5.2.12

网站的其余部分运行良好.

The rest of the site runs fine.

推荐答案

B.5.2.9.MySQL 服务器已消失 MySQL 手册的部分列出了此错误的可能原因.

The B.5.2.9. MySQL server has gone away section of the MySQL manual has a list of possible causes for this error.

也许您正处于其中一种情况?-- 特别是考虑到你正在运行一个长时间的操作,关于 wait_timeout 可能很有趣...

Maybe you are in one of those situations ? -- Especially considering you are running a long operation, the point about wait_timeout might be interesting...

这篇关于PDO:MySQL 服务器已经消失的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆