MySQL problem (MyBB)

Permabanned
Joined
30 Nov 2008
Posts
731
Location
Manchester
I've set up a forum that been going to around 2 weeks everything seems to be running fine but on occasion people including me are getting weird MySQL errors. When they refesh 1-3 times it usually goes.

But why is it coming? I've had a google and it said something about enabling auto_reconnect? But it wasn't well documented and i don't know where to add it.

Any ideas?
Thank you.
 
2003 is a connection error to the SQl server, could mean a lot of things

1053 means a server shutdown is in progress, not had this before and had to google it. This is normally caused by a cronjobs being carried out (server side)

2013 is a connection lost error, normally caused by a timeout error or filesizes being set very low in the server config.

I'd get hold of your hosting company, sounds like either your software is bad or the server is.
 
I've got into contact with them, but all they said is to try and do this auto reconnect thing. Which i have no idea how to.
 
They ask you to in-corperate this in to your code? It sounds like a cop out to me, I've only ever had some of those errors on shockingly bad hosts.

If your running a php script, add this to your header file or something that is called each page

my_bool reconnect = 1;
mysql_options(&mysql, MYSQL_OPT_RECONNECT, &reconnect);

I found this code and a decent explanation on the 2nd result of a google search "enable auto_connect" :/
 
Back
Top Bottom