“error establishing a database connection” in a previously working WordPress site

My site just crashed!!! I received the oh-so-helpful error “establishing a database connection” when I went to my site. Other sites on the server were fine.  The site was working fine, and my config had not changed. The httpd error log showed nothing.

Then I found this in the MySQL logs (/var/log/mysqld.log)

[ERROR] /usr/libexec/mysqld: Table ‘./db_name/wp_options’ is marked as crashed and should be repaired

To fix I ran:

mysql -e “use db_name;REPAIR TABLE wp_options”

And we are back . . .


Posted

in

,

by

Tags:

Comments

2 responses to ““error establishing a database connection” in a previously working WordPress site”

  1. Aman Avatar
    Aman

    Did you determine the cause?

  2. jbmurphy Avatar

    Nope. Since it was the wp_options table, I figured the data could be re-created.