If someone faces the error next time follow the instructions.
Wordpress provides a built-in utility to repair the database. It is disabled by default, because it has no access controls and could be a security issue. We will enable the feature, run the repairs, and then disable it.
Find
wp-config.php file via cPanel -> File Manager -> WP. Then on any blank line paste
define('WP_ALLOW_REPAIR', true); . This defines a variable that Wordpress looks for when determining if it should enable the repair feature. Save and close the file.
Switch over to your browser and load the WP admin area again. A database repair page will load:
Press the
Repair Database button, and you'll be taken to a results page where you can see the checks and repairs happening in real-time:
Once the process finishes, be sure to open up the wp-config.php file again, and remove the line we just pasted in.
Did you notice any repairs being made? Try your site again, and check whether the error is gone.