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
- Open phpMyAdmin from your control panel.
- Click your database on the left.
- Tick the box beside the broken table.
- In the With selected menu, choose Repair table.
Idea 2: Repair in cPanel
- Open MySQL Databases in cPanel.
- Find Modify Databases.
- 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.
Quick recap
- Corruption means a table file is damaged, often after a crash.
- Back up first, then try Repair in phpMyAdmin or cPanel.
mysqlcheckcan fix many tables at once.- InnoDB tables need a restart or a backup restore.
- Ask support if nothing works.