1. cvrle77

    cvrle77 Well-Known Member

    Aug 21, 2009
    5,794
    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:

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

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

    [​IMG]

    Then run this command:

    Code:
    myisamchk -r /var/lib/mysql/YOURDBHERE/wp_options.MYI
    [​IMG]

    and last, but not least start mysqld:

    Code:
    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
    3,796
    Add this into your article, this is best method for repairing DB.
     
  3. quain88

    quain88 Well-Known Member

    Dec 27, 2011
    288
    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
    1,822
    Nice, Thanks!:]
     

Share This Page