According to various websites on this issue where I was researching this information there is a way to create a custom html/php page to output when a database error occures.  This was implemented in version 2.3.2 of WordPress.

One is:

What does this mean for ComicPress users?  Well it means several things by reading that particular post.   It means that when you are Digg’d or any other thing that might have consequences on your website and your site goes down; you’re stuck not knowing it’s down until someone notifies you or you happen to look.   Which means your missing out on a huge majority of possible readers.

This article mentions that it’s not sending out the proper header identification of a 500 error in the normal error code, however since this article was released the code change was made in current releases of WordPress to properly send that 500 error out.

The actual function in the core WordPress is in the wp-includes/functions.php file in the function  dead_db()

As everyone says though, its very unwise to make edits to core files so modifying or creating a db-error.php file and placing it into the /wp-content/ directory is a very valid solution.   It will let you create a custom page in the look and feel that your normal site has. (without using any normal wp calls), straight html.

I’ve made a mock up using directions based on the article above and placed it in this file for you to download, rename to .php, edit it and place it into your /wp-content/ directory.

// Custom DB-Error.PHP by Joost De Valk (Additions by Philip M. Hofer(Frumph))
// Credits: Joost de Valk  -
// If it's a 500 error, send the header for a 500 error.
// this only works if your email server doesn't require authentication to send mail.
// If you have SMTP authentication there is a workaround but requires some modifications if someone wants to
// work on code to do it.
// info here: using Pear
header("HTTP/1.0 500 Internal Server Error");

*	Uncomment this area to allow emails sent to you when this happens ^^ read above
*	replace my name with yours, my email with your email
/* Remove this line if you want to be mailed.
 $mailto 	= "Your Name";
 $mailfrom 	= "";

 if ($_SERVER['REQUEST_URI'] != "/wp-content/db-error.php") {
	$headers 	= "From: ".$mailfrom."rn".
		"Reply-To: Your Namern".
		"X-Mailer: PHP/".phpversion()."rn".
		"X-Priority: 1 (High)";
	$message	= "Go fix it!nn".
		"It broke when someone tried to open this page:
		"Your WordPress installation";
	$subject	= "DB error at ".$_SERVER['SERVER_NAME'];
Remove this line if you want to be mailed. */

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">
<html xmlns="">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<title>Yet Another Database Error!</title>

	<h1>Error establishing a database connection</h1>

– Phil