An Aria table fails with 'Read page with wrong checksum' (error 1030, code 176)
#1030 - Got error 176 "Read page with wrong checksum" from storage engine AriaShort answer
Code 176 means MariaDB's Aria engine read a data or index page whose checksum does not match, so that table file is damaged. Aria holds the mysql system tables and many temporary tables. Check the table, then repair it: REPAIR TABLE while the server runs, or aria_chk with the server stopped. Back up the files before you repair.
Fix it fast
1Find out which cause you have
Find out which table raises the error and whether it is an Aria table. The mysql schema is Aria, so a failing login or privilege lookup often points there.
SELECT table_schema, table_name, engine FROM information_schema.tables WHERE engine = 'Aria' AND table_schema NOT IN ('information_schema');2Match what you see, then jump to its fix
- 1
The error repeats on one table and other tables workOne Aria table file is damagedFix - 2
The error is in the log at startup and no client can connectThe server cannot start or stay up, so SQL repair is not possibleFix - 3
The server fails at startup with a message such as Missing valid id in the aria_control_fileThe Aria control file or transaction logs are corruptFix
- 1
What does the error look like?
#1030 - Got error 176 "Read page with wrong checksum" from storage engine AriaERROR 1030 (HY000): Got error 176 "Read page with wrong checksum" from storage engine Aria
Cause 1 of 3
One Aria table file is damaged
1Check
Run a check on the table while the server is up. The SQL statements replace aria_chk when the server is running.
CHECK TABLE mysql.proc;2Fix
Copy the table files first, then repair the table from SQL. REPAIR TABLE supports Aria tables; QUICK repairs only the index and leaves the data file alone.
REPAIR TABLE mysql.proc QUICK;
-- if CHECK TABLE still reports errors
REPAIR TABLE mysql.proc;3Verify
CHECK TABLE reports status OK.
CHECK TABLE mysql.proc;Confirmed by mariadb.com
Cause 2 of 3
The server cannot start or stay up, so SQL repair is not possible
1Check
aria_chk works on the .MAI files on disk. The server must be stopped; the docs warn that aria_chk should not be used while MariaDB is running.
sudo systemctl stop mariadb
cd /var/lib/mysql
sudo aria_chk --check mysql/*.MAI2Fix
Repair the damaged tables with --recover, and use --safe-recover only when --recover cannot fix the data file. -B keeps a backup of the data file first.
sudo aria_chk --recover --backup mysql/proc.MAI
# only if the line above fails
sudo aria_chk --safe-recover mysql/proc.MAI3Verify
A second check run finishes without errors, and the server starts.
sudo aria_chk --check mysql/*.MAI
sudo systemctl start mariadbConfirmed by mariadb.com
Cause 3 of 3
The Aria control file or transaction logs are corrupt
1Check
After an unclean shutdown Aria recovers from its logs. If the control file or the aria_log files are damaged, recovery itself fails.
sudo ls -l /var/lib/mysql/aria_log_control /var/lib/mysql/aria_log.*2Fix
With the server stopped and the files copied away, delete the control file and all aria_log files. On the next open of an Aria table the server checks and repairs it automatically. The file names can differ by version, so match the names in your data directory.
sudo systemctl stop mariadb
sudo mkdir /root/aria-logs-backup
sudo mv /var/lib/mysql/aria_log_control /var/lib/mysql/aria_log.* /root/aria-logs-backup/
sudo systemctl start mariadb3Verify
The server starts and CHECK TABLE passes on the Aria tables.
sudo journalctl -n 30 -u mariadb.serviceConfirmed by mariadb.com
How do I stop it coming back?
- Take a backup of the data directory or a logical dump on a schedule, and test a restore.
- Stop the server cleanly before copying or moving the data directory.
- Watch the disk and filesystem health logs; repeated checksum errors can point at the storage under the database.
Sources
How was this page made?
I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.
Which stack is behind this page?
Projects of mine built on the same technologies:
- TaxiDexMy own multi-tenant taxi dispatch SaaS: API, dispatcher portal, driver and passenger apps, and the servers underneath.
- QistLockA NestJS and React SaaS driving an Android Device Owner agent that locks financed phones when payments lapse.
- ShopGoAn e-commerce aggregator with a Python scraping engine behind its catalog, past 10K Google Play downloads.
Related fixes
Databases
Installing the Airflow MySQL provider fails on pkg-config or mysqlclient
Building the mysqlclient wheel fails during the install
The Airflow MySQL provider depends on mysqlclient, which pip compiles against the MySQL C client library.
2 causes, each with a fixDatabases
Compiling a C or C++ program that includes mysql.h fails
undefined reference to `mysql_init'
The compiler only finds mysql.h when the MySQL client development files are installed and their folder is on the include path.
3 causes, each with a fixDatabases
An EC2 instance cannot reach its RDS database
Could not open connection to the host, on port <port>: Connect failed
RDS denies all access until a security group allows it.
3 causes, each with a fixDatabases
Locked out of a fresh MariaDB install as root on Mac or Linux
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
A fresh MariaDB root account is not a normal password account.
3 causes, each with a fixDatabases
The client cannot open a TCP connection to MariaDB or MySQL (error 2003)
ERROR 2003 (HY000): Can't connect to MySQL server on '127.0.0.1:3306' (111)
Error 2003 means the client tried a TCP connection to the host and port and nobody answered.
4 causes, each with a fixDatabases
MariaDB will not start after a move: Can't create test file ... lower-test
[ERROR] Aborting
The server writes a small test file in its data directory at startup.
4 causes, each with a fix