MySQL Forums :: General :: Switching to backup DB on error


Advanced Search

Switching to backup DB on error
Posted by: Ian Estis ()
Date: December 13, 2009 06:21PM

I am running several sites on shared hosting accounts. I am setting up my program so that if there is an error with the first database it will automatically switch to the backup database. I can handle all the code to make it switch but my question is what error messages will generally be thrown when there are too many users connected to the db or the server is down or the server is out of resources?

I don't want to connect to the backup database if there is a syntax error, but if there is any kind of server side error that would not be caused by incorrect MySQL code being sent to the server then I want to make sure that the program switches over to the backup db.

What error codes should I look for to make sure my program will always switch to the backup database for any error that would be caused by my hosting provider having issues with a database server, but also make sure that the program will not switch to the backup database for any syntax errors or other errors that could be caused by the code I send to the MySQL server?

Options: ReplyQuote


Subject Written By Posted
Switching to backup DB on error Ian Estis 12/13/2009 06:21PM
Re: Switching to backup DB on error Rick James 12/15/2009 12:19AM
Re: Switching to backup DB on error Ian Estis 12/15/2009 04:25PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.