WordPress relies on its MySQL/MariaDB database to store posts, pages, users, and settings. Sometimes, database tables can become corrupted or misconfigured, leading to errors such as “Error establishing a database connection” or missing content. On ruachost.com, you can repair these tables using built‑in WordPress tools or phpMyAdmin.
Common Causes of Database Table Problems
-
Unexpected server shutdowns.
-
Incomplete plugin/theme installations.
-
Manual edits to the database.
-
Disk or hosting environment errors.
Method 1: Repair Database via wp-config.php
-
Log in to your hosting panel or access your WordPress files via FTP.
-
Open the wp-config.php file in the root directory.
-
Add the following line just before
/* That's all, stop editing! Happy publishing. */:define('WP_ALLOW_REPAIR', true); -
Save the file.
-
In your browser, visit:
https://yourdomain.com/wp-admin/maint/repair.php -
Choose Repair Database or Repair and Optimize Database.
-
Once complete, remove the line from wp-config.php for security.
✅ WordPress will attempt to fix corrupted tables automatically.
Method 2: Repair Tables via phpMyAdmin
-
Log in to your hosting control panel (cPanel/Plesk).
-
Open phpMyAdmin.
-
Select your WordPress database.
-
Check the box next to the corrupted tables.
-
From the dropdown menu at the bottom, select Repair Table.
-
phpMyAdmin will attempt to fix the selected tables.
Important Notes
-
Always back up your database before making changes.
-
If corruption persists, consider restoring from a backup.
-
Some plugins may cause recurring issues, disable suspicious plugins and test.
-
For large sites, use Repair and Optimize to improve performance.