How to repair crashed wp_options table, when phpmyadmin doesn't do the job

Status
Not open for further replies.

cvrle77

Active Member
5,787
2009
4,353
10
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:

FdHjbhm.png


Then run this command:

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

QSjYSwy.png


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.
 
3 comments
thanks for this tutorial, everytime i run into error database connection, i just restart my server and everything goes fine :)
 
Status
Not open for further replies.
Back
Top