Title: custom database error message
Last modified: August 18, 2016

---

# custom database error message

 *  [danielos](https://wordpress.org/support/users/danielos/)
 * (@danielos)
 * [20 years, 11 months ago](https://wordpress.org/support/topic/custom-database-error-message/)
 * I am using wordpress 1.5.
    Occaisonally, it can’t connect to the database for
   one reason or another,and it puts up a generic wordpress “cannot establish database
   connection” message. Not that it looks bad, but I’d like to know how to customize
   it. Any tips on what file to look in for this?
 * Thanks.

Viewing 9 replies - 1 through 9 (of 9 total)

 *  [Mark (podz)](https://wordpress.org/support/users/podz/)
 * (@podz)
 * [20 years, 11 months ago](https://wordpress.org/support/topic/custom-database-error-message/#post-220234)
 * That’s a hosting issue – email their support and ask if they have any problems.
 *  Thread Starter [danielos](https://wordpress.org/support/users/danielos/)
 * (@danielos)
 * [20 years, 11 months ago](https://wordpress.org/support/topic/custom-database-error-message/#post-220238)
 * I know that it’s a hosting problem…. I’m just wanting to know how to customize
   the error message.
 *  Moderator [James Huff](https://wordpress.org/support/users/macmanx/)
 * (@macmanx)
 * [20 years, 11 months ago](https://wordpress.org/support/topic/custom-database-error-message/#post-220246)
 * You will find the error message in the wp-db.php file. Feel free to customize
   as you see fit.
 *  Thread Starter [danielos](https://wordpress.org/support/users/danielos/)
 * (@danielos)
 * [20 years, 11 months ago](https://wordpress.org/support/topic/custom-database-error-message/#post-220248)
 * thanks!
 *  Thread Starter [danielos](https://wordpress.org/support/users/danielos/)
 * (@danielos)
 * [20 years, 11 months ago](https://wordpress.org/support/topic/custom-database-error-message/#post-220255)
 * Wait. one more question:
    I’m in the middle of making the custom error message
   right now, so I purposely messed up the config on [http://danielosullivan.com/](http://danielosullivan.com/)
   so I can see what I am doing.
 * The CSS info for the database error messages isn’t in wp-db.php file. Only the
   xhtml part is there. Where can I find the CSS part?
 *  [Mark (podz)](https://wordpress.org/support/users/podz/)
 * (@podz)
 * [20 years, 11 months ago](https://wordpress.org/support/topic/custom-database-error-message/#post-220262)
 * Probably wp-admin.css
 * Given you see this so often you want to style it, I would suggest both backing
   up your data and moving to a decent host.
 *  Thread Starter [danielos](https://wordpress.org/support/users/danielos/)
 * (@danielos)
 * [20 years, 11 months ago](https://wordpress.org/support/topic/custom-database-error-message/#post-220266)
 * I don’t really see it that often. I purposely made it happen this time so I could
   see what I’m doing. It’s only caused by the host once a month or less.
 *  [davgam](https://wordpress.org/support/users/davgam/)
 * (@davgam)
 * [20 years, 7 months ago](https://wordpress.org/support/topic/custom-database-error-message/#post-220744)
 * It would be nice if this error message could be pulled out into a template file
   somehow. The point isn’t that you need a host that doesn’t go down (always going
   to be some downtime in a shared hosting environment, which most WP blogs run 
   on I would guess). The point is that the identity of the site is lost for visitors
   hitting an error. It would be useful to be able to make the error message appear
   similar to the rest of the site with a message asking them to try back in a while.
 *  [ejm](https://wordpress.org/support/users/llizard/)
 * (@llizard)
 * [20 years, 5 months ago](https://wordpress.org/support/topic/custom-database-error-message/#post-220798)
 * danielos wrote:
    …………………………………… : The CSS info for the database error : messages
   isn’t in wp-db.php file. :…………………………….
 * There is a CSS section. It is at the bottom of includes/wp-db.php
 * look just below the following coding:
 * **function bail($message) { // Just wraps errors in a nice header and footer**

Viewing 9 replies - 1 through 9 (of 9 total)

The topic ‘custom database error message’ is closed to new replies.

## Tags

 * [database](https://wordpress.org/support/topic-tag/database/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 9 replies
 * 5 participants
 * Last reply from: [ejm](https://wordpress.org/support/users/llizard/)
 * Last activity: [20 years, 5 months ago](https://wordpress.org/support/topic/custom-database-error-message/#post-220798)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
