2006 MySQL server has gone away
Posted: Thu Dec 04, 2008 7:46 pm
I have been getting the following mysql error in my oscommerce cart lately and it's causing many problems:
2006 MySQL server has gone away
this happens randomly and after much research I have come to the conlusion that my host server wait timeout setting was to blame and/or server load. Since I am unable to change this server setting I tried this solution:
This seemed to help a bit but the problem still is occuring. The problem usually happens during checkout when it takes a few seconds to process payment via api and performing a database insert. I have tried optimising and repairing tables with no effect.
Can anyone offer any suggestions other then switching hosting companies? I was hoping there was something I could do with code to eliminate this issue.
Thanks.
It might have something to do with curl_exec.
2006 MySQL server has gone away
this happens randomly and after much research I have come to the conlusion that my host server wait timeout setting was to blame and/or server load. Since I am unable to change this server setting I tried this solution:
Code: Select all
tep_db_close ();
tep_db_connect() or die('Unable to connect to database server!'); Can anyone offer any suggestions other then switching hosting companies? I was hoping there was something I could do with code to eliminate this issue.
Thanks.
It might have something to do with curl_exec.