Home  >  Article  >  Database  >  遭遇MySQL server has gone away的问题_MySQL

遭遇MySQL server has gone away的问题_MySQL

WBOY
WBOYOriginal
2016-06-01 13:39:13898browse

遭遇MySQL server has gone away的问题 一个开发MM的项目(PHP+MySQL)的PHP项目今天出现了MySQL server has gone away的错误,MySQL服务器端表示毫无压力。 

 而通过mysql客户端的连接方式mysql -hxx -uxx -pxx databasename -e xxx则毫无问题 而App服务器的netstat -a | grep 3306  | grep TIME_WAIT个数非常小,只有2个。 

MySQL在连接超时这块的参数如下

 root@(none) 09:24:51>show variables like '%out%'; +------------------------------+----------+ | Variable_name                | Value    | +------------------------------+----------+ | connect_timeout              | 10       | | delayed_insert_timeout       | 300      | | handlersocket_timeout        | 300      | | handlersocket_wrlock_timeout | 12       | | innodb_lock_wait_timeout     | 100      | | innodb_rollback_on_timeout   | OFF      | | interactive_timeout          | 28800    | | lock_wait_timeout            | 31536000 | | log_output                   | FILE     | | net_read_timeout             | 30       | | net_write_timeout            | 60       | | slave_net_timeout            | 3600     | | wait_timeout                 | 28800    | +------------------------------+----------+   

最终MM把PHP连接MySQL的连接方式从长连接改成了短连接,就再没出现了。  bitsCN.com

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn