Forum Moderators: coopster

Message Too Old, No Replies

mysqli connect errno 2003

         

eatspinach

3:59 pm on Mar 5, 2010 (gmt 0)

10+ Year Member



hello

i keep getting the following error on my website. Can't connect to MySQL server on 'localhost'. Errorcode: 2003.i have searched all over the internet for help on this issue and cant figure it out.

the problem only occurs when the website is running on the server. it works fine locally.

I was thinking this could be a firewall problem, as it is running perfectly on my local machine, and I compared my local sql config file and the php.ini file with the files on server one and they are fairly identical. To rule out the firewall as a problem i booted onto the server and ran the site from there and the problem still existed.

The problem occurs when I am executing a query that populates the fusion chart daily over a year. so their is a lot of results being brought back.

I am finding this problem most unusual because firstly, it is not a timing problem, as the error pops up only 12 seconds from the time I press the submit button and max execution time is set at 120 seconds.

And secondly, the request executes fine the first time, its only when I press the submit button the second time the error occurs.

has anyone have any suggestions?
thanks for reading this, all help appreciated.
Dave

Anyango

7:56 pm on Mar 5, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Does it somehow kill mysql ? after execution of your request first time does mysql keep running?

eatspinach

9:49 am on Mar 8, 2010 (gmt 0)

10+ Year Member



It completely kills mysql, I even have to wait a while before i am able to log back into the website. I stepped down through the code there and I commented out the lines

$mysqli->kill($mysqli->thread_id);
$mysqli->close();

Just to see if it stopped the problem, but it did nothing. I could post the code if that would help? (its a lot of code)

eatspinach

10:06 am on Mar 8, 2010 (gmt 0)

10+ Year Member



I solved the problem, their was so much code that I accidentally overlooked a "$mysqli->close();" inside in the code.

Thanks for your help, it was still useful to know to be looking for something that was killing the connection!

Anyango

3:04 pm on Mar 8, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



;) Cheers