0

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?

Abstractor
  • 216
  • 2
  • 12

1 Answers1

0

The error 'Lost connection to MySQL server during query' usually occurs due to some trouble in network connectivity. Possible causes and solution are -

  1. Please try to increase net_read_timeout.
  2. Check onnect_timeout - Default is 10 sec , increase it to larger value.
  3. Increase max_allowed_packet.

More details are mentioned here:

http://dev.mysql.com/doc/refman/5.1/en/error-lost-connection.html

Error Code: 2013. Lost connection to MySQL server during query

Community
  • 1
  • 1
sandra kevin
  • 199
  • 2
  • 6