开发者

A simple query causing the "the server is gone away" message

Have just got a surprise and would appreciate some suggestions. The simple query below updates a table. I have used it severally without qualms but now it does not work as usual causing the MySQL server to go away. What could be responsible. Thanks.

UPDATE rmc_raw_data 
    INNER
    JOIN handover_main
        ON handover_main.handover_time = rmc_raw_data.rmc_time
        AND handover_main.handover_date = rmc_raw_data.rmc_date
        SET rmc_raw_data.handovers = 'H开发者_运维百科andover'


It would be advisable to go through the list here - they have quite useful checklist/instructions on what to check.

It explains what are the most common and some of the less common reasons for the quoted message, how to test for them and where to look.

Normally, in a way it should not have anything to do with your SQL but with settings.

Apart from the first and most obvious reason (timeout) I would also try to establish if the behaviour is the same when query is run through command line client/script, compared to for example running it through php (and/or whatever your environment is), JDBC/ODBC perhaps as well.

If behaviour always the same I would concentrate on the server settings (using the mysql docs).


Increase the timeout of the session. It's most likely set to 5 minutes or so which is too short for long running queries.

Here are the details from the mysql documentation: http://dev.mysql.com/doc/refman/5.1/en/gone-away.html

Here are the details for changing the timeout options: http://dev.mysql.com/doc/refman/5.1/en/mysql-options.html

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜