Bug #2110 | MySQL server has gone away (max_allowed_packet) | ||
---|---|---|---|
Submitted: | 13 Dec 2003 17:05 | Modified: | 13 Dec 2003 20:04 |
Reporter: | André Wösten | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Server | Severity: | S2 (Serious) |
Version: | 4.0.16 | OS: | Linux (Linux) |
Assigned to: | Michael Widenius | CPU Architecture: | Any |
[13 Dec 2003 17:05]
André Wösten
[13 Dec 2003 20:04]
Michael Widenius
Sorry, I don't know how to set max_allowed_packet in PHP, but I hope to be able to explain how things work, which should enable you to fix this quickly. Both server and client has the max_allowed_packet parameter for the client/server protocol). This parameters is a safety parameter that tells how big packet it should accept (as a safety meassure to not run out of memory). Note that the packets are allocated dynamicly and MySQL will not allocate more memory than is needed even if max_allowed_packet is too big. If the reader gets a packet bigger than max_allowed_packet then it will assume something is wrong and abort the connection. In other words: - If the client sends a packet to a MySQL server that is bigger than max_allowed_packet, the server will terminate the connection. - If the server sends a packet to a MySQL client that is bigger than max_allowed_packet, the client will terminate the connection. To fix your problems (retriving a big blob to PHP) you have to set max_allowed_packet to a big value in your PHP environment. Hope the above helps. Regards, Monty