Index: wp-includes/wp-db.php
===================================================================
--- wp-includes/wp-db.php	(revision 26836)
+++ wp-includes/wp-db.php	(working copy)
@@ -1154,6 +1154,13 @@
 
 		if ( !$this->dbh ) {
 			wp_load_translations_early();
+
+			// Load custom DB error template, if present.
+			if ( file_exists( WP_CONTENT_DIR . '/db-error.php' ) ) {
+				require_once( WP_CONTENT_DIR . '/db-error.php' );
+				die();
+			}
+			
 			$this->bail( sprintf( __( "
 <h1>Error establishing a database connection</h1>
 <p>This either means that the username and password information in your <code>wp-config.php</code> file is incorrect or we can't contact the database server at <code>%s</code>. This could mean your host's database server is down.</p>
