This error usually pops up at the most unexpected times and places, and usually in an already working client application/website.
Here are a couple of reasons you get this error on the client-side while communicating with MySQL:
1. BLOBs
Another primary cause for this error, is when you update or select tables containing large blobs. By default MySQL's max_allowed_packet is set to 1MB. Should your update-SQL grow larger than this MySQL parameter, MySQL will simply drop the connection. This can easily happen with even a 512MB blob value, as blob values are usually hexed and thus takes two hex values per byte of the blob.
2. Client Timeouts
Most MySQL servers have at least three primary timeout settings for a client connection, connect, read and write timeouts. These control how long your client should wait for a response from the server when it
[Read more...]