From what i have mentioned before, we can use a program to monitor the WordPress MySQL server, when the server is down, WordPress will auto send an e-mail and write to a text log file in a recorded. Now, WordPress 2.3.2, the latest version of the popular blogging platform allows you to define a custom database error page.
It is very simple. Just follow the following steps and within a few minutes your custom database error page is ready!
First, upload a file named log.txt to the WordPress root directory, chmod it to 666.
Second, Download the file db-error.php and upload it to WordPress content directory(wp-content/db-error.php).
Finally, replace the e-mail address of the code to your own e-mail.
That's it! From now on this error file will be report the error whenever your WordPress blog has encountered some trouble connecting to the database server.