I have a query that is about 10000 characters long and it fails with the following error:
ERROR 2013 (HY000): Lost connection to MySQL server during query
This only happens when a local client (either PHP or CLI) connects to a remote database server.
If I try to do this same query from another (windows) maxhine, it works perfectly on the same database server. So the server settings are not the problem.
I have tried adding --max_allowed_packet=16M
to my mysql client startup, but still the error occures.
Further testing reveals that the max query length that can be executed is limited at around 5000 characters.
Some version info:
mysql -V
mysql Ver 14.14 Distrib 5.5.32, for debian-linux-gnu (x86_64) using readline 6.2
Any idea what I could try?