Jump to content
  • Checkout
  • Login
  • Get in touch


The e-commerce.

How do you handle sudden database blackouts ?


Recommended Posts

Hi there,


I want to ask you, how you handle sudden blackouts of your database ?


Is there a function in osC included, that redirects the user to a static page in a.m. case ?

Or are you using 2 independent database servers, that covers each other in a.m. case ?


If there is nothing (no function or mechanism) and the webserver is still alive, the user only gets a message :

Warning: mysql_connect(): Can't connect to MySQL server on ...


This is only a simple text message / static error page, but with no special webserver error code like 404, 500, etc.

So, there is no possibility to filter such an error code (no way I know).



And therefore, I want to ask you again, how you handle sudden blackouts of your database ?


Thanks for your input.



Link to comment
Share on other sites

If you're losing database access on a regular basis, I'd get that fixed first as it ain't normal.


Ideally, there should be comprehensive error trapping in osC which would re-direct to a static page when an error occurs. But there isn't - I'm not a programmer so I don't know how much work would be involved in adding it.


You could run mySQL on its own seperate server, with a slave on the web host server for fallback but you'd have to be doing a fair bit of business to justify the extra expense.


I haven't had any unplanned downtime on my server (which runs mysql and the web server) over the last two years and its been running (without a reboot) for 15 months now.

Link to comment
Share on other sites

Thanks for your reply.

I'm not loosing the database connection on a regular basis, so nothing I have to fix first.


What I meant, was, when your provider has to do some work on the network or a server and due to this, you have a database blackout.


This happened to me with my provider 2 times now, so I thought, that a redirection to a static page would be good to handle the upcoming errors in such a situation.


But how do I have to do this ?

Do I have to implement in each page in the root folder a small routine in the beginning like this :


check database ...is dead => redirect to static page

else (is alive) => continue


I'm not a php programmer, so its hard for me to struggle through this.

But thats the way I can image this.


Any help for this routine welcome.


Thanks in advance,

kind regards


Link to comment
Share on other sites


This topic is now archived and is closed to further replies.

  • Create New...