GICT knowledge base
How to Repair Database Through WordPress Dashboard?
Published
How to Repair Database Through WordPress Dashboard?
In WordPress “Error establishing a database connection”, is a very common error when you try to access your website. In most case this issue is, one of the following:
1) The database has been corrupted. The database stores all the important data of your website including posts, comments, user accounts information’s, etc.
2) As we all know the database details are configured in the wp-config.php file. If we configure wrong details of the database, we will get this error.
3) If the mysql service is stopped, you will get this error.
In most of this case, we can’t access both website and the WordPress Dashboard. Some case we can access the WordPress dashboard when we get the error “Error establishing a database” while accessing the website. If we got wp-admin access and main domain is still loading with “Error establishing a database connection” that means “One or more database tables are unavailable”. The database may need to be repaired to resolve this issue. In this case, we can repair the database through wp-admin.
1) First, take current database backup.
2) To enable repair option
Edit wp-config.php file
Add below line in the wp-config.php file
define(‘WP_ALLOW_REPAIR’, true);
3) Go to the following page to repair database https://www.yourdomain.com/wp-admin/maint/repair.php
4) From there click “Repair and Optimize Database” button.
Make sure to disable the repair option once the database has been repaired.
If the issue still persists after repairing the database, you need to restore the database from an available backup.
To troubleshoot the error “Error establishing a database connection”, refer following KB How To Fix “Error Establishing Database Connection” In WordPress
If you need any further assistance please contact our support department.
Related guides
7 Common Hosting Mistakes Beginners Make (And How to Avoid Them)
7 common hosting mistakes beginners make in 2026: no backups, ignored updates, bad host choice, weak passwords, single point of failure, no staging. With fixes for each.
WordPressWebsite Migration Backup Checklist: What to Save and How to Test
Prepare a website migration backup: inventory files, databases, email and DNS, check archive integrity, test recovery and plan a safe final synchronization.
WordPressCore Web Vitals in 2026: A Practical Fix Guide for Site Owners
Core Web Vitals 2026: practical fixes for LCP, INP, and CLS. Real root causes, what to measure, common misconceptions, and a priority order of fixes for site owners.
WordPressFixing the WordPress “Death Loop”: When Missing Files slow down your site
You’ve just launched your new WordPress site or pushed a big update. In your staging environment, everything ran perfectly.
