0

I am using Google App Engine along with Cloud SQL.
My application cannot connect to MySQL about 35% of requests.
PHP throws error: MySQL server has gone away

After SQL restart it works well for few minutes, then same thing again. If I connect from hosts other than App Engine then connection is fine.

What is going on here? My business halted completely because of it.

Max Tsepkov
  • 466
  • 6
  • 15
  • I have seen the same issue on other platforms and resolved it by putting my connect inside a `for (i =0; i<3; i++)` loop. Usually it succeeds on the second attempt. You can also potentially resolve it by turning off persistent connections. – Nick May 14 '18 at 07:31
  • Try to check this post [https://stackoverflow.com/questions/47857403/gcp-mysql-server-has-gone-away-google-sql-mysql-2nd-gen-5-7 ] that has a similar issue and let us know if the solutions offered helped you to solve your issue. – gr7 May 14 '18 at 08:22

1 Answers1

0

I disabled persistent connections and it works now.

Max Tsepkov
  • 466
  • 6
  • 15