WordPress Database errors on DigitalOcean

The new droplet on Digital Ocean has been working really well. Much faster than bluehost, but I am getting an outage about once every two weeks. The droplet seems to hang with a “no database connection” message.

I normally just restart the droplet, but it is not good. The bluehost site would stay up for years literally with no issues. So time to debug.

https://www.wpbeginner.com/wp-tutorials/how-to-fix-the-error-establishing-a-database-connection-in-wordpress/ is a good place to start. Says that when this happens, try the administration user interface located at `/wp-admin` to see if perhaps there is a problem with database corruption. A good idea.

To repair it, you need to hack at your wp-config.php and add the line

define(‘WP_ALLOW_REPAIR’, true)

Then you go to `wp-admin/maint/repair.php` and you can fix your database

I’m Rich & Co.

Welcome to Tongfamily, our cozy corner of the internet dedicated to all things technology and interesting. Here, we invite you to join us on a journey of tips, tricks, and traps. Let’s get geeky!

Let’s connect