# mysql – Table is marked as crashed and should be repaired

## The Question :

203 people think this question is useful

I am getting this error in wordpress phpMyadmin

#145 - Table './DB_NAME/wp_posts' is marked as crashed and should be repaired



My website is currently down because of this.

I googled this problem, but I don’t see the “repair” button on phpMyadmin. Please let me know how to fix this. I am not sure where to issue PHP command. Please advise, my proficiency with PHP is very basic.

228 people think this answer is useful

Here is where the repair button is:

193 people think this answer is useful

Run this from your server’s command line:

 mysqlcheck --repair --all-databases



128 people think this answer is useful

I had the same issue when my server free disk space available was 0

You can use the command (there must be ample space for the mysql files)

REPAIR TABLE <table name>;



for repairing individual tables

28 people think this answer is useful

Connect to your server via SSH

then connect to your mysql console

and

USE user_base
REPAIR TABLE TABLE;



# -OR-

If there are a lot of broken tables in current database:

mysqlcheck -uUSER -pPASSWORD  --repair --extended user_base



If there are a lot of broken tables in a lot of databases:

mysqlcheck -uUSER -pPASSWORD  --repair --extended -A



11 people think this answer is useful

When I got this error:

#145 – Table ‘.\engine\phpbb3_posts’ is marked as crashed and should be repaired

I ran this command in PhpMyAdmin to fix it:

REPAIR TABLE phpbb3_posts;



myisamchk -r /DB_NAME/wp_posts