Group Admins

WordPress Troubleshooting and Support

Public Group active 1 year, 4 months ago ago

WordPress support from our community

Database Connection Error

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • #3325
    Patrick Ingle

    A tip:

    If your site is constantly getting the dreaded database connection error and would like to show a better message, create a new file name db-error.php in the wp-content directory. Keep in mind, you do not have access to WP functions or core API and this file contents should be straight PHP and HTML code. You can have an entertaining image shown and get the current path from the $_SERVER parameter.

    Additionally, using you can send yourself a mobile text message every time your database goes down. You should have unlimited text on your phone and curl support on your server. Keep these text messages short. I also included the remote_addr, request_uri and the jsonized request parameter.

    Then I noticed the WP heartbeat was taking down my website, and disabled the heartbeat. More information about the WP heartbeat can be found at

    Patrick Ingle

    Adding the db-error.php file to my site and sending a text message that includes the remote_addr, query and request, identified an hack attempt trying to login, showing the userid/password combinatoion the hacker was using. The hack originated from the netherlands.

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.