Skip to main content
When there is a problem with the database, WordPress shows a database connection error. Usually, the error appears when the WordPress database connection configuration is not correct, database server issue, or the database is corrupted. However, if the database server is working correctly and the connection configuration did not change, this could mean that the database is corrupted and it needs to be repaired.WordPress comes with a tool to fix a damaged WordPress tables.This article describes how to repair a WordPress database.

Fixing WordPress database problems

To repair database issues in WordPress, follow these steps:
  1. Log in to cPanel.
    📘 Note If you do not know how to log in to your cPanel account, please see this
    article.
  2. In the FILES section of the cPanel home screen, click File Manager:
  3. In the left sidebar, click the name of the directory where you have installed WordPress, and locate the wp-config.php file:
  4. Open the wp-config file in a code editor
  5. Scroll down to the end of the file, and add the following line to enable the Repair Database Feature: