Economicalhost · Knowledge Base
Knowledge Base › Databases › How to Repair a MySQL Database
Databases

How to Repair a MySQL Database

Database corruption can cause errors or missing data. cPanel and phpMyAdmin both offer simple repair tools that fix most table-level problems.

Step-by-step

  1. Back up the database first — even a damaged one — via export, so nothing is lost.
  2. Open Databases → MySQL Databases in cPanel.
  3. Scroll to "Modify Databases" → Check Database, select the database and run the check to find errors.
  4. If errors are found, use Repair Database on the same page and select the database.
  5. Alternatively, use phpMyAdmin — open the database, tick the affected tables, and choose "Repair table" from the With selected dropdown.
  6. Re-test your site. If corruption persists, restore from a clean backup — see recovering from backup.

💡 Good to know

  • Repeated corruption can indicate a deeper issue — contact EconomicalHost support if it recurs.
  • Always export before repairing, so a failed repair does not make things worse.
  • Optimising afterwards keeps the database healthy — see optimising.