Using wp-config.php to Automatically Repair WordPress Database Problems
If you are trying to load your WordPress site in any way, be in a post, page, or even the WordPress Dashboard, and are seeing the following message, this indicates that there is a problem with your Database.
To allow use of this page to automatically repair database problems, please add the following line to your wp-config.php file. Once this line is added to your config, reload this page.
To fix this, you will need FTP/SFTP/SSH access to your server.
Step 1) Log in to your server with FTP/SFTP or SSH.
Step 2) Locate and open wp-config.php
Step 3) Add the following line and save wp-config.php
Step 4) Visit http://www.yoursite.com/wp-admin/maint/repair.php and you will see the following
Step 5) Click “Repair” or “Repair and Optimize” and wait for the script to run. You will see a message similar to the following if it is successful.
Step 6) As instructed, remove define(‘WP_ALLOW_REPAIR’, true); from wp-config.php and save.
If this doesn’t work, feel free to try a Database Repair using phpMyAdmin