Index: wp-includes/wp-db.php
===================================================================
--- wp-includes/wp-db.php	(revision 25876)
+++ wp-includes/wp-db.php	(working copy)
@@ -1145,6 +1145,11 @@
 		}
 
 		if ( !$this->dbh ) {
+			// 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();
+			}
 			wp_load_translations_early();
 			$this->bail( sprintf( __( "
 <h1>Error establishing a database connection</h1>
