« A Holiday Message (and Gift!) from Modwest | Main | Email changes: Attachment Size, Spam Filtering »

January 16, 2008

TrackBack

TrackBack URL for this entry:
http://www.typepad.com/services/trackback/6a00d8341c263353ef00e54ff630fa8834

Listed below are links to weblogs that reference Database Server Maintenance - Jan 17:

Comments

jmasterson

I've recently set up graceful database connection problem handling for one of the sites I maintain. Here's a quick way to do it.

First, create a static HTML page which explains that there was a problem connecting the the database, but all is well and soon you'll be back and functioning at full capacity.

Next, in your PHP mysql_connect() code, redirect the browser to the static HTML page conditionally -- if the database connection fails. For example:

if(!$dbh = mysql_connect("db1.modwest.com", $myuser, $mypass) )
{
header("Location: http://mysite.com/errorpage.html \n");
exit;
}


If your database connection code exists within the HTML output of your dynamic pages, however, the header() won't work. In that case, you might just want to print an explanatory message on the page, or use the META tag as described here:

http://webmaster.iu.edu/tool_guide_info/refresh_metatag.shtml

If you run into trouble, just let us know at support at modwest dot com and we'll try and point you in the right direction.

-JM

Kevin Delaney

JM ... you can also accomplish the same thing using "include()", where the included script prints the error message.

Anyway, The acquisition MySQL by Java will be interesting. Perhaps it is time to brush off my old Java books. I prefer Java as a language. I just never liked their connection to the database.

Verify your Comment

Previewing your Comment

This is only a preview. Your comment has not yet been posted.

Working...
Your comment could not be posted. Error type:
Your comment has been posted. Post another comment

The letters and numbers you entered did not match the image. Please try again.

As a final step before posting your comment, enter the letters and numbers you see in the image below. This prevents automated programs from posting comments.

Having trouble reading this image? View an alternate.

Working...

Post a comment

March 2010

Sun Mon Tue Wed Thu Fri Sat
  1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30 31      

Modwest.com >>
Modwest System Status >>