469,090 Members | 1,085 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,090 developers. It's quick & easy.

Database was unreachable, had to kill over 10 processes, why?

Hello,

I just had an unhappy unincident. I did a spot check on one of my PHP/MySQL
pages and when I tried running the page I got an "Unable to connect to
database" error which is what the PHP code driving the page reports when the
MySQL connect attempt bombs out.

I went into PHPMyAdmin and ran "Show Processes". What I found was over 10
processes still trying to INSERT a record, all with a LOCKED status. I
manually killed every process and as soon as I did that everything started
working again.

Note, my database runs on an external web hosting service that I have an
account with.

What could have caused this situation? It has never happened before. Are
there some extra provisions I can take in my code to prevent or recover from
this?

thx

--

Robert Oschler
"Let the web hear you, add your voice to your web site in minutes!"
-- http://audiodirect.spiderchase.com/
(For a limited time, free voiceover with every sign-up, use this link
instead)
-- http://audio.spiderchase.com/
(A song - are you blue?)
-- http://bluedreams.spiderchase.com/
Jul 19 '05 #1
2 2790
make sure you are not connecting to the database in each loop you might
have. That will spawn a process for each time it loops.

connect outside the loop and the run your queries off the one connection.

if you are already doing this, then post a snip of the mysql code in your
php script
"Robert Oschler" <no_replies@fake_email_address.invalid> wrote in message
news:NQ******************@news2.news.adelphia.net. ..
Hello,

I just had an unhappy unincident. I did a spot check on one of my PHP/MySQL pages and when I tried running the page I got an "Unable to connect to
database" error which is what the PHP code driving the page reports when the MySQL connect attempt bombs out.

I went into PHPMyAdmin and ran "Show Processes". What I found was over 10
processes still trying to INSERT a record, all with a LOCKED status. I
manually killed every process and as soon as I did that everything started
working again.

Note, my database runs on an external web hosting service that I have an
account with.

What could have caused this situation? It has never happened before. Are
there some extra provisions I can take in my code to prevent or recover from this?

thx

--

Robert Oschler
"Let the web hear you, add your voice to your web site in minutes!"
-- http://audiodirect.spiderchase.com/
(For a limited time, free voiceover with every sign-up, use this link
instead)
-- http://audio.spiderchase.com/
(A song - are you blue?)
-- http://bluedreams.spiderchase.com/

Jul 19 '05 #2
make sure you are not connecting to the database in each loop you might
have. That will spawn a process for each time it loops.

connect outside the loop and the run your queries off the one connection.

if you are already doing this, then post a snip of the mysql code in your
php script
"Robert Oschler" <no_replies@fake_email_address.invalid> wrote in message
news:NQ******************@news2.news.adelphia.net. ..
Hello,

I just had an unhappy unincident. I did a spot check on one of my PHP/MySQL pages and when I tried running the page I got an "Unable to connect to
database" error which is what the PHP code driving the page reports when the MySQL connect attempt bombs out.

I went into PHPMyAdmin and ran "Show Processes". What I found was over 10
processes still trying to INSERT a record, all with a LOCKED status. I
manually killed every process and as soon as I did that everything started
working again.

Note, my database runs on an external web hosting service that I have an
account with.

What could have caused this situation? It has never happened before. Are
there some extra provisions I can take in my code to prevent or recover from this?

thx

--

Robert Oschler
"Let the web hear you, add your voice to your web site in minutes!"
-- http://audiodirect.spiderchase.com/
(For a limited time, free voiceover with every sign-up, use this link
instead)
-- http://audio.spiderchase.com/
(A song - are you blue?)
-- http://bluedreams.spiderchase.com/

Jul 19 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

6 posts views Thread by Bob Swerdlow | last post: by
3 posts views Thread by pattanawadee | last post: by
reply views Thread by Darren Mart via DotNetMonster.com | last post: by
7 posts views Thread by Joe | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by kglaser89 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.