MySQL / MariaDB Error 1030 Got error 176 “Read the page with wrong checksum” – Safe Repair Guide
When MySQL or MariaDB throws this error: ERROR 1030 (HY000): Got error 176 “Read the page with wrong checksum” from storage engine it usually means some kind of corruption or mismatch in your table pages. In simple terms, MySQL reads a data page from disk, calculates its checksum, and the value does not match the expected one. That is a red flag for data damage or hardware/filesystem issues.
This guide walks you through understanding the problem and fixing it as safely as possible.
1. What this checksum error actually means
Storage engines like InnoDB store data in pages (for example 16 KB blocks). Each page has a checksum. When MySQL reads a page:
- It loads the page from disk.
- Recalculates the checksum.
- Compares it with the stored checksum.
If they differ, you see error 176 “Read the page with wrong checksum”.
Common reasons:
- Sudden power loss while writing.
- Disk problems or bad sectors.
- Filesystem issues.
- A crash during
ALTER TABLEor heavy writes. - Rarely, bugs in certain engine versions.
Because this points to corruption, the priority is to protect your remaining data.
2. First step: create a full backup (even if damaged)
Before you try any repair command, take a backup of whatever MySQL can still read.
If the server is running and most databases are OK:
mysqldump -u root -p --all-databases --single-transaction --quick > alldb_backup.sql
If only one database is affected:
mysqldump -u root -p --single-transaction --quick your_database > your_database_backup.sql
If mysqldump fails on the corrupted table, you may still be able to dump the healthy tables by excluding that one.
Example:
mysqldump -u root -p your_database --ignore-table=your_database.broken_table > your_database_partial.sql
Even a partial backup is better than nothing.
3. Check MySQL error log for more clues
Look at the MySQL or MariaDB error log. The path depends on your system, common locations:
/var/log/mysql/error.log/var/log/mysqld.log/var/log/mariadb/mariadb.log
Search for your table name or for checksum messages. You might see something like:
InnoDB: Database page corruption on disk or a failed
InnoDB: file read of page 12345
This confirms which table or index page is damaged.
4. Run CHECK TABLE to confirm the affected table
Use the MySQL client:
mysql -u root -p
Inside the console:
USE your_database;
CHECK TABLE broken_table;
Output might show:
broken_table | warning | Table is marked as crashed
broken_table | error | Got error 176 "Read the page with wrong checksum" from storage engine
Now you know exactly which table is damaged.
5. Safe repair options for MyISAM tables
If the table engine is MyISAM (you can check with SHOW TABLE STATUS LIKE 'broken_table';), you can use REPAIR TABLE. MyISAM repairs can still lose some rows, so keep that backup.
REPAIR TABLE broken_table;
If you want extended checking:
REPAIR TABLE broken_table EXTENDED;
On the command line you can also use myisamchk when MySQL is stopped:
sudo systemctl stop mysql
myisamchk --recover /var/lib/mysql/your_database/broken_table.MYI
sudo systemctl start mysql
Always work on a copy of the .MYD and .MYI files if possible:
cp broken_table.MYD broken_table.MYD.bak
cp broken_table.MYI broken_table.MYI.bak
6. Safe repair strategy for InnoDB tables
For InnoDB, you do not use myisamchk. There are a few safer approaches:
6.1 Try a logical ALTER TABLE
If InnoDB can still read most of the table, a rebuild can bypass the corrupted page:
ALTER TABLE broken_table ENGINE=InnoDB;
This forces MySQL to create a new copy of the table. If the error appears during this step, the corruption might be in a critical area and you may need more advanced recovery.
6.2 Export healthy rows to a new table
You can often copy the readable portion of the table into a new one.
CREATE TABLE broken_table_new LIKE broken_table;
INSERT INTO broken_table_new
SELECT * FROM broken_table
WHERE 1;
If the insert stops with the checksum error, try inserting in smaller chunks by primary key ranges:
INSERT INTO broken_table_new
SELECT * FROM broken_table
WHERE id BETWEEN 1 AND 10000;
Repeat with different ranges, skipping the range that triggers the error. You might lose a few rows but keep most of your data.
After that:
RENAME TABLE broken_table TO broken_table_bad,
broken_table_new TO broken_table;
Keep broken_table_bad around in case you later try deeper recovery.
7. Check your disk and filesystem
Since checksum mismatch often points to physical issues, it is smart to verify your disk.
On Linux:
sudo smartctl -a /dev/sda
Look for reallocated sectors, pending sectors, or other SMART errors.
For filesystem checks (run only when unmounted or in rescue mode):
sudo fsck -f /dev/sda1
If you find hardware problems, plan to move the database to a healthy disk as soon as possible.
8. InnoDB force recovery (last resort)
If MySQL refuses to start because of corruption, there is an emergency option called innodb_force_recovery. Use it only to get data out, not for normal operation.
In my.cnf or mysqld.cnf under [mysqld]:
innodb_force_recovery = 1
Then restart MySQL and try to dump the affected database:
mysqldump -u root -p your_database > emergency_dump.sql
If level 1 is not enough, you can try higher values (up to 6), but the higher the number, the more risk of more damage if you keep writing. The usual process is:
- Set
innodb_force_recovery. - Start MySQL.
- Export data.
- Stop MySQL.
- Remove the setting.
- Recreate the database from the dump.
9. Restore from a clean backup if available
If you have a recent full backup and the corrupted table is important, the safest fix is to restore from backup to a fresh server or instance, then switch your application over.
Relying only on repair tools after a strong corruption can leave hidden issues inside indexes that show up later under load.
10. Preventing future checksum errors
A few best practices help reduce the chance of ever seeing error 1030 again:
- Use a reliable server with ECC RAM and good disks (SSD/NVMe with power-loss protection).
- Enable the operating system’s write cache safely or disable it if the hardware lacks protection.
- Make regular logical backups with
mysqldumpormysqlpump, plus physical backups with tools likextrabackup. - Shut down MySQL cleanly before stopping the server.
- Keep MySQL / MariaDB up to date with the latest stable bugfix releases.
- Monitor disk health with
smartctland alerts.
MySQL / MariaDB error 1030 with code 176 is scary because it hints at corrupted data pages, but with careful backups, controlled repairs, and disk checks you can often recover most or all of your data and bring the server back to a stable state.