2

We are running on Google Compute Engine/Debian9/PHP/Lumen/Doctrine2 <-> Google SQL MySQL 2nd Gen 5.7.

Usually it works without hiccups, but we are now getting error messages, similar to the one below, with increasing frequency:

Error while sending QUERY packet. PID=123456

PDOStatement::execute(): MySQL server has gone away

Any idea why this is happening and how i would fix it?

QHarr
  • 83,427
  • 12
  • 54
  • 101
rbarab
  • 39
  • 5
  • Please see this question and its answers https://stackoverflow.com/questions/2232150/pdo-mysql-server-has-gone-away. If this is not your case, give us more details. Also look at this list of possible causes for that _MySQL server has gone away_ message: https://dev.mysql.com/doc/refman/5.7/en/gone-away.html – Victor M Perez Dec 22 '17 at 21:37
  • Did you solve the issue with the links provided? Please confirm – Victor M Perez Dec 25 '17 at 08:38
  • 1
    We have changed the server to high availability and seems that it's resolved now. – rbarab Mar 12 '18 at 11:20

1 Answers1

0

As noted here, there is a list of cases which may be causing this error. A few are:

  • You have encountered a timeout on the server side and the automatic reconnection in the client is disabled (the reconnect flag in the MYSQL structure is equal to 0).
  • You can also get these errors if you send a query to the server that is incorrect or too large...An INSERT or REPLACE statement that inserts a great many rows can also cause these sorts of errors.

. . .

Please refer to the link for a complete list.

Also, there see this answers on the same problem.

Victor M Perez
  • 2,185
  • 3
  • 19
  • 22