I run a WordPress website. Today I found that wp_posts table is crashed. When I tried to repair the table, I got the following error:
REPAIR TABLE wp_posts;
error Can't create new tempfile: './[databasename]/wp_posts.TMD'
repair status Operation failed
I tried to run the following command in shell:
myisamchk -r -f wp_posts.MYI
error: File 'wp_posts.MYI' doesn't exist
Can you please tell me what else I can try to fix this problem?
Turned out that "myisamchk -r -f wp_posts.MYI
" was the correct solution. I just had to go to the data folder.
In my CentOS system, I changed directory to /var/lib/mysql/[database]/
and found wp_posts.MYI
After removing this file, repair was successful.
Try stopping your service using the following command sudo service mysql stop
Now do the repair check myisamchk -r -f -o /var/lib/mysql/DatabaseName/wp_posts
Start your service and enjoy it!
It works for me
Try adding the following line to your wp-config.php file:
define( 'WP_ALLOW_REPAIR', true );
Then go to: /wp-admin/maint/repair.php
That should take effect and automatically repair your crashed table.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With