1. cvrle77

    cvrle77 Well-Known Member

    Aug 21, 2009
    So you are hosting wordpress blog on VPS, and there were some server/wordpress updates, or similar disasters that caused your wordpress options tables to crash?

    You are getting message: Error establishing a database connection ?

    You don't have a backup, and hosting staff is incompetent, and asking from you database backup to restore it?

    You tried PHPMyAdmin to repair tables, but it doesn't work? You get some dumb 'blob' messages from phpmyadmin?

    You are pulling your hair out? Being bold is not trendy but here's the solution:


    Well, solution is quite simple, but took me plenty of time to find working solution.

    Solution is applied through SSH, since repairing tables from phpmyadmin in this case didn't work.

    first you need to stop mysqld service by typing:

    service mysqld stop
    then run this command (ofc if you are running centos)

    myisamchk /var/lib/mysql/YOURDBNAME/*.MYI
    Search through output, and find something like this:


    Then run this command:

    myisamchk -r /var/lib/mysql/YOURDBHERE/wp_options.MYI

    and last, but not least start mysqld:

    service mysqld start
    Then check your site, it should load now.

    You can copy this article, but you must link back to original source.
  2. CJ

    CJ Well-Known Member Respected

    Nov 21, 2009
    Add this into your article, this is best method for repairing DB.
  3. quain88

    quain88 Well-Known Member

    Dec 27, 2011
    thanks for this tutorial, everytime i run into error database connection, i just restart my server and everything goes fine :)
  4. ThumperTM

    ThumperTM Well-Known Member

    Jan 4, 2011
    Nice, Thanks!:]

Share This Page