MySQL server has gone away

时光毁灭记忆、已成空白 提交于 2019-12-02 19:06:30

问题


I executed this query on my MySql Server and it is giving me "MySQL server has gone away" Error.In following query my both table have more then 1000000 rows.

SELECT a_tab_11_10.url as url,a_tab_11_10.c5 as 't1',a_tab_12_10.c3 as 't2' 
FROM a_tab_11_10 join a_tab_12_10 on (a_tab_11_10.url)=(a_tab_12_10.url) 
order by (a_tab_11_10.c5-a_tab_12_10.c3) desc limit 10 

here is my log file but i am not getting it. Thank you @Faisal for answer and i check my log file but i am not getting it..

110111 10:19:50 [Note] Plugin 'FEDERATED' is disabled.
110111 10:19:51 InnoDB: Started; log sequence number 0 945537221
110111 10:19:51 [Note] Event Scheduler: Loaded 0 events
110111 10:19:51 [Note] wampmysqld: ready for connections. Version: '5.1.36-community-log' socket: '' port: 3306 MySQL Community Server (GPL)
110111 12:35:42 [Note] wampmysqld: Normal shutdown
110111 12:35:43 [Note] Event Scheduler: Purging the queue. 0 events
110111 12:35:43 InnoDB: Starting shutdown...
110111 12:35:45 InnoDB: Shutdown completed; log sequence number 0 945538624
110111 12:35:45 [Warning] Forcing shutdown of 1 plugins
110111 12:35:45 [Note] wampmysqld: Shutdown complete>
110111 12:36:39 [Note] Plugin 'FEDERATED' is disabled.
110111 12:36:40 InnoDB: Started; log sequence number 0 945538624
110111 12:36:40 [Note] Event Scheduler: Loaded 0 events
110111 12:36:40 [Note] wampmysqld: ready for connections. Version: '5.1.36-community-log' socket: '' port: 3306 MySQL Community Server (GPL)
110111 12:36:40 [Note] wampmysqld: Normal shutdown
110111 12:36:40 [Note] Event Scheduler: Purging the queue. 0 events
110111 12:36:40 InnoDB: Starting shutdown...
110111 12:36:42 InnoDB: Shutdown completed; log sequence number 0 945538634
110111 12:36:42 [Warning] Forcing shutdown of 1 plugins
110111 12:36:42 [Note] wampmysqld: Shutdown complete
110111 12:36:52 [Note] Plugin 'FEDERATED' is disabled.
110111 12:36:52 InnoDB: Started; log sequence number 0 945538634
110111 12:36:52 [Note] Event Scheduler: Loaded 0 events
110111 12:36:52 [Note] wampmysqld: ready for connections. Version: '5.1.36-community-log' socket: '' port: 3306 MySQL Community Server (GPL)
110111 12:37:42 [Note] wampmysqld: Normal shutdown
110111 12:37:42 [Note] Event Scheduler: Purging the queue. 0 events
110111 12:37:42 InnoDB: Starting shutdown...
110111 12:37:43 InnoDB: Shutdown completed; log sequence number 0 945538634
110111 12:37:43 [Warning] Forcing shutdown of 1 plugins
110111 12:37:43 [Note] wampmysqld: Shutdown complete
110111 12:37:46 [Note] Plugin 'FEDERATED' is disabled.
110111 12:37:46 InnoDB: Started; log sequence number 0 945538634
110111 12:37:46 [Note] Event Scheduler: Loaded 0 events
110111 12:37:46 [Note] wampmysqld: ready for connections. Version: '5.1.36-community-log' socket: '' port: 3306 MySQL Community Server (GPL)


回答1:


The most common reason for the MySQL server has gone away error is that the server timed out and closed the connection.

Check this link for more details -

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




回答2:


This error happens when the connection you established with mysql_connect is closed and the handle MYSQL* is not valid anymore. It should have nothing to do with the query itself, in fact, if the query is wrong, you get a different error message.

You should check why the connection is closed. Does mysql daemon is restarted? do you use more than one thread and a different thread invokes mysql_close?



来源:https://stackoverflow.com/questions/4655165/mysql-server-has-gone-away

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!