WordPress Database Table Error
Two days ago, out of nowhere, a particular table in the WordPress in hongkiat.com went corrupted. The ‘wp_comments‘
table of the WordPress database just crashed without signs, warnings
nor error messages. So how did I came to know? Here are the symptoms:
In PhpMyadmin, select the WordPress database and look for the error table. In my case, the ‘wp_comments‘ table. Check it, and scroll all the way down and look for ‘With selected‘ drop-down box. Select Repair table and things should be alright.
- If you try to back up your database, you’ll be thrown with this error message – wp_comments is marked as crashed and should be repaired when using LOCK TABLES
- Recent comments widget appears blank.
- Top commenter widget appears blank.
- Comment posted will not be written into DB, therefore will not be shown.
- Comments section in WP Admin appears to have zero records.
The fix / Solution
To fix this, you must have access to the wordpress database, either via PhpMyAdmin or Secure Shell (SSH). Most shared hosting account comes with phpMyAdmin, but either option you should be extremely careful because you dealing with the database. Any wrong move will cause more data lost.PhpMyAdmin
In PhpMyadmin, select the WordPress database and look for the error table. In my case, the ‘wp_comments‘ table. Check it, and scroll all the way down and look for ‘With selected‘ drop-down box. Select Repair table and things should be alright.
Secure Shell
- Login to your shell
- Enter ‘mysql -u username -p database_name‘ to access databases
- Enter ‘show databases;’ to view all databases
- Enter ‘use database_name;‘ to engage the database
- Enter ‘show tables;‘ to show all tables within the database
- Enter ‘check table wordpress_table_name‘ to verify this is the corrupted table
- Fix it with ‘repair table wordpress_table_name‘
- Enter ‘check table wordpress_table_name‘ again to make sure it’s fixed
0 comments:
Post a Comment