I was just looking at RobsNotebook.com and came across a really good solution to a common problem with Wordpress.
Lately, I have been getting a lot of error messages on my blog that said “MySQL server has gone away.” I looked through the Godaddy support forums hoping to find a solution. Unfortunately, I did not.
But then I found RobsNotebook.com and they had a page dedicated to this problem. It turns out that it is caused by the SQL connection being open for too long. Essentially, Wordpress does not close the connection every time.
Godaddy’s (or insert your own host here) configuration of MySQL tells it to time out after a certain period, and that can happen in the middle of your call to the database.
RobsNotebook.com has provided a php file that you use in wordpress and just replace your existing file. He made it so easy that it takes only about 5 minutes to put in the solution.
P.S. I verified that the php page was correctly coded and had no “funny business” on it, but as the file could change at any time, it is always good to look through it for yourself whenever you download and use PHP from the net.

#1 by Jim - 406NotAccceptable at March 1st, 2008
| Quote
At least you didn’t have my mySQL problem (that sounds strange!) I had a silly plugin that got spammed and then decided to query all the spams, 50k rows at a time!
You can guess how my host reacted!
#2 by yo at August 21st, 2008
| Quote
yo,im also on godaddy
and i must say that error (sever has gone) when running longer sql queries really pissed me off.
though,the solution seems to be to mysql_close() the connection before it exceeds the time limit what actually probably causes godaddy service to close the connection itself.
but what i just recently noticed is,
check out Mysql Proccesslist on Godaddy MYSQL Servers,
you will see the port changes,that could be one reason why it says “Server gone”.
so each time you close the connection and estabilish a new one it catches the new port(which could have changed in an interval of max time).
So there are 2 theories:
1.Godaddy simply set a quite short maximum of connection time. : Workarround => mysql_close();
2.Godaddy changes port in an unknown interval(would need some research to find it out). : Workarround => mysql_close();
Maybe mysql_free_ressources also can help a bit,but i dont think so(just give it a try
so the final solution seems to be to close the godaddy mysql connection as fast as possible.
close,connect … probably wont cause your server to crash(not really similiar to DOS) so no worries!
#3 by mine at October 21st, 2008
| Quote
It works for me.
Thanks alot.