MySQL – server has gone away, a new discovery

A long time ago, i wrote an article to show you how to deal with ‘mysql server gone away’ issue of mysql server. i hope it helped you guys to deal with this common issue as much as it did to me.

Recently, i fell into another mysql server gone away trap, i tried to fix it knowledge from the above article. It didn’t help 🙁 . so i decided to debug it and found the solution finally.

The solution is really simple: Don’t use socket connection or localhost to connect to mysql server in your apps. this fix will work when you have a lot of virtual hosts on your server. mysql won’t be able to handle so many socket requests at once, but if you connect to your local host server ip, it will receive query requests and handle internally with socket.

I hope this will help :). please leave comments if you still experience ‘mysql server gone away’ after trying my 2 articles (this and on on the link above)