Copyright (C) 2000-2012 |
GNU Info (mysql.info)Gone away`MySQL server has gone away' Error ---------------------------------- This section also covers the related `Lost connection to server during query' error. The most common reason for the `MySQL server has gone away' error is that the server timed out and closed the connection. By default, the server closes the connection after 8 hours if nothing has happened. You can change the time limit by setting the `wait_timeout' variable when you start `mysqld'. Another common reason to receive the `MySQL server has gone away' error is because you have issued a "close" on your MySQL connection and then tried to run a query on the closed connection. You can check that the MySQL hasn't died by executing `mysqladmin version' and examining the uptime. If you have a script, you just have to issue the query again for the client to do an automatic reconnection. You normally can get the following error codes in this case (which one you get is OS-dependent): `CR_SERVER_GONE_ERROR' The client couldn't send a question to the server. `CR_SERVER_LOST' The client didn't get an error when writing to the server, but it didn't get a full answer (or any answer) to the question. You can also get these errors if you send a query to the server that is incorrect or too large. If `mysqld' gets a packet that is too large or out of order, it assumes that something has gone wrong with the client and closes the connection. If you need big queries (for example, if you are working with big `BLOB' columns), you can increase the query limit by starting `mysqld' with the `-O max_allowed_packet=#' option (default 1M). The extra memory is allocated on demand, so `mysqld' will use more memory only when you issue a big query or when `mysqld' must return a big result row! automatically generated by info2www version 1.2.2.9 |