Topic: Occasional Failures In Php Connect Or Select mySQL DB (Read 609 times)
I love Pokemon
Posts: 13
86 credits Members referred : 0
« on: Jun 30, 2008, 11:48:27 AM »
I have a funny problem with Php, and I was wondering if someone either met it already or has some ideas about a solution.
All works smooth, but occasionally although FTP and mySQLAdministrator still work fine and the site is accessible, Php apparently fails to connect to the DB.
It may happen a few times a day, normally lasts about one or two minutes, then it can connect again. It truly seems something in the Php/DB interface. Either it cannot connect to it, or it cannot select the right db.
That snippet works as I said - it just stubborny and occasionally fails and throws the error. Any idea? Something gross that has escaped my attention?
Thanks in advance
« Last Edit: Jun 30, 2008, 11:53:55 AM by Fullposter »
What's HTML?
Gender:
Posts: 408
2466 credits Members referred : 2
« Reply #1 on: Jun 30, 2008, 02:07:58 PM »
Not a MySQL expert but it seems that if it "occasionally" don't work it might be a problem in your database server !!! not responding, overloading ? Have you tried your code on your local machine ?
I love Pokemon
Posts: 13
86 credits Members referred : 0
« Reply #2 on: Jun 30, 2008, 04:42:27 PM »
Yes as a matter of fact on localhost this issue never occurs. Of course I have contacted several times the server administrator but he says his logs report nothing. The database seems ok for also when I get that php error, I can still smoothly query the server db via mysql administrator.
So, if no one has other ideas, has someone any clue about what exactly could be wrong on the server? If so, I could give some good hint to the administrator.
For some funny reason it affects only my site, for the server hosts other sites also apparently (i don't know all the details unfortunately and you know how difficult it can be to talk with a server admin)
thank you
Global Moderator Community Supporter?
Jedai Sword Master
Gender:
Posts: 6487
39754 credits Members referred : 374
It's time to use PHP5!
« Reply #3 on: Jul 01, 2008, 12:19:59 AM »
sounds to me that the server doesn't accpet no more connections (hosting companies will say always that everything is right) try debug the whole stuf (send an email to yourself if an mysql connection error happens)
I love Pokemon
Posts: 13
86 credits Members referred : 0
« Reply #6 on: Jul 01, 2008, 03:09:45 PM »
OK I have an option maybe: any idea what strings in php.ini or mysql inis may affect these behaviours and what their better values could be? There is plenty of stuff there and maybe a tailored reply would help me at least to look to the right needle in the haystack :-) maybe i can persuade my server admin to check them
thank you a lot!
Global Moderator Community Supporter?
Jedai Sword Master
Gender:
Posts: 6487
39754 credits Members referred : 374
OK I have an option maybe: any idea what strings in php.ini or mysql inis may affect these behaviours and what their better values could be? There is plenty of stuff there and maybe a tailored reply would help me at least to look to the right needle in the haystack :-) maybe i can persuade my server admin to check them
thank you a lot!
sounds like a mysql setting (max. connections (my.cnf)
I love Pokemon
Posts: 13
86 credits Members referred : 0
« Reply #8 on: Jul 01, 2008, 04:00:23 PM »
I found a my.ini file nbut no cnf. Is the my.ini the file one can edit to affect mysql behaviours? It is... empty!
I love Pokemon
Posts: 13
86 credits Members referred : 0
« Reply #9 on: Jul 01, 2008, 04:05:40 PM »
by the way, since it is empty or, better, that my.ini includes only two lines of text, any good tutorial about how to configure it with more option, of course if you advise for it?
I am doing my 'homework' on google but as you an imagine i am overwhelmed with data that doesn't meet my need so maybe some of you know already where i can find directions (or just give them here) about a few good edits to that file uh? thank you
I love Pokemon
Posts: 13
86 credits Members referred : 0
Of course suggestions are appreciated The only problem I need to prepend in square brackets some sort of command, apparently [mysqld] but the server is a windows server and i don't know if [mysqld] is correct or it should be something like, say [WinMysqld] and if it's case sensitive or what. Damn computers!
Global Moderator Community Supporter?
Jedai Sword Master
Gender:
Posts: 6487
39754 credits Members referred : 374
It's time to use PHP5!
« Reply #11 on: Jul 01, 2008, 04:22:50 PM »
I don't know how it works on windows systems, you should host on a real (linux) server
I don't know how it works on windows systems, you should host on a real (linux) server
for now i am stuck there, well yes we are planning to move elswehere, in the meanwhile a windows solution too would be useful (well not only for me after all the htread is public lol)
Global Moderator Community Supporter?
Jedai Sword Master
Gender:
Posts: 6487
39754 credits Members referred : 374
It's time to use PHP5!
« Reply #13 on: Jul 01, 2008, 05:52:08 PM »
the problem is that maybe your whole application need to get updated after the move to another plattform
I am a metal monkey!
Administrator Community Supporter?
Jedai Sword Master
Gender:
Posts: 8272
42619 credits Members referred : 3
« Reply #14 on: Jul 01, 2008, 08:14:20 PM »
This settings should be different in each server. I mean it depends on your server's hardware, the other services that you are using, the traffic, the type of the queries you run, etc.
Anyway as my.cnf is supposed to give directives for the whole server, I don't think that your hosting company will give you the ability to change them.
This settings should be different in each server. I mean it depends on your server's hardware, the other services that you are using, the traffic, the type of the queries you run, etc.
Anyway as my.cnf is supposed to give directives for the whole server, I don't think that your hosting company will give you the ability to change them.
If they give you such ability probably its somewhere in their Help Files and tutorials or knowledgebase of how to do things (tweak things) in your account