Flash Sale:75% Off Hosting + Free DomainEnds in13h47m14sView Plans
Hostvento logoHostvento

Fix a Corrupted MySQL Table

This guide gives simple ideas to repair a MySQL table that is damaged.

Databases2 min read7 steps

What is a corrupted table?

MySQL is a database. It keeps your website's data in tables. A table is like a spreadsheet page. A table is corrupted when its file gets damaged. This can happen when the server crashes, the disk fills up or power goes out in the middle of a save.

Signs are errors like "Table is marked as crashed" or a website that shows blank pages.

Warning: Take a backup before you try a repair. A repair can lose rows that are already damaged.

Idea 1: Repair in phpMyAdmin

  1. Open phpMyAdmin from your control panel.
  2. Click your database on the left.
  3. Tick the box beside the broken table.
  4. In the With selected menu, choose Repair table.

Idea 2: Repair in cPanel

  1. Open MySQL Databases in cPanel.
  2. Find Modify Databases.
  3. Pick your database in Repair DB and click Repair DB.

Idea 3: Use a command (SSH)

SSH lets you type commands on the server. This command checks and repairs all tables in one database.

mysqlcheck -u username -p --auto-repair --check databasename

Replace username and databasename with yours. It asks for your password. The command checks every table and tries to fix broken ones.

To repair one table in SQL, run this.

REPAIR TABLE tablename;

Idea 4: InnoDB tables

InnoDB is a common table type. The REPAIR TABLE command does not work on it. Often a restart of MySQL fixes small problems, because it recovers on start. Server owners with root access can restart it with systemctl restart mysqld. If it still fails, ask support.

Idea 5: Restore a backup

If a repair fails, restore your latest good backup. Import the saved file with phpMyAdmin.

Tip: Take regular backups. They are the safest way to recover from corruption. If you need help, open a support ticket.

Quick recap

  • Corruption means a table file is damaged, often after a crash.
  • Back up first, then try Repair in phpMyAdmin or cPanel.
  • mysqlcheck can fix many tables at once.
  • InnoDB tables need a restart or a backup restore.
  • Ask support if nothing works.