繁体   English   中英

MySQL服务器不见了

[英]MySQL server has gone away

我一直在进行数据查询,它将使用给定的参数从表中选择一条记录。

当它在localhost中使用时,它一直运行良好,但是在上载和在生产站点中使用时,它将引发错误。

请看看错误

exception 'CDbException' with message 'CDbCommand failed to execute the SQL
statement: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away.
The SQL statement executed was: SELECT id from MST_PERSON WHERE last_name =
'name' and first_name = 'name'  and middle_name = 'name'  and
birth_date = 'date' limit 1 '

我试过增加sql的wait_timeout,但是没有运气。

提前致谢。

编辑您的my.cnf ..如果是Linux,则需要使用: vim /etc/mysql/my.cnf

加:

max_allowed_packet=500M

然后restart mysql

我在Google中看到了问题,它说更改my.cnf wait_timeout = 28800

http://dev.mysql.com/doc/refman/5.1/en/gone-away.html

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM