Wordpress and MySQL – error establishing a database connection


Vinh Nguyen


January 18, 2011

My server's been going down quite often recently (once a week). I believe it is a problem with the disk. Usually rebooting the server makes everything (including my blog) work again. Recently, I got the message "error establishing a database connection" even after the reboot. After many tries, this worked for me. Basically, my options table (prefix_options) was broken. Fixing it using phpMyAdmin worked.

Before fixing the database, I thought it was a disk error. I tried using the Linux Rescue Disk to fix the disk based on this, but badblocks didn't report anything back, and I couldn't use fsck. I'll give it another try if the problem persists.