I am getting this error in wordpress phpMyadmin
#145 - Table './DB_NAME/wp_posts' is marked as crashed and should be repaired
When I login to phpMyadmin, it says wp_posts is “in use”
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.
Here is where the repair button is:
Run this from your server’s command line:
mysqlcheck --repair --all-databases
To avoid a ‘access denied’ error, you might have to add the username and password to this command. mysqlcheck -uroot -p --repair --all-databases
and supply the password.
–
slight edit: mysqlcheck -u root -p –repair –all-databases
–
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
Helpful, I had this problem with a Drupal v7.6x UC table, which suddenly played up; issued the REPAIR TABLE command as above in the phpMyAdmin SQL console and fixed it. Thank goodness for stackoverflow!! Cheers!
–
Or the error “The storage engine for the table doesn’t support repair”
–
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
Do not put passwords in command line, they are then saved in the history in a non-secured way and location. mysql commands lets you pass the parameter -p
alone, and will then ask you for your password.
–
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;
This means your MySQL table is corrupted and you need to repair it. Use
myisamchk -r /DB_NAME/wp_posts
from the command line. While you running the repair you should shut down your website temporarily so that no new connections are attempted to your database while its being repaired.
I asked this to the comment above but I think he is signed out, so asking it to you again. “Thanks a lot, my site is back online again. One question though, as the database was corrupted and I repaired it again, should I be worried about anything? Should I investigate if that made anything else break? Or this should have taken care of everything?”
–
You should not be worried about anything. Once database is repaired your site will work again. It may get corrupted again at some point, it happens, just repair it again. Also do backups regularly and you will be fine
–
Here is simple steps.
Go to phpmyadmin and checked that table which one crushed and then select Repair table option.
source : https://stackoverflow.com/questions/4357270/table-is-marked-as-crashed-and-should-be-repaired