Home Issue Fixing "Table is crashed and last repair failed" (Error 144) in MySQL/MariaDB

Fixing "Table is crashed and last repair failed" (Error 144) in MySQL/MariaDB

Last updated on Jul 13, 2025

Have you ever encountered the "Table is crashed and last repair failed" (error 144) error preventing your MySQL or MariaDB from starting? This error often appears when a database table is severely corrupted and previous repair attempts have failed. If the corrupted table is a critical system table (e.g., within the mysql database), it can halt your entire database system.

This article will guide you through the detailed steps to resolve this error using an offline repair method.

Typical Symptoms

You might see error messages similar to these in your MySQL/MariaDB error log:


2023-09-12 12:00:27 0 [ERROR] mariadbd: Got error '144 "Table is crashed and last repair failed"' for './mysql/db'
2023-09-12 12:00:27 0 [ERROR] Fatal error: Can't open and lock privilege tables: Got error '144 "Table is crashed and last repair failed"' for './mysql/db'
2023-09-12 12:00:27 0 [ERROR] Aborting

If MySQL/MariaDB can't start, you won't be able to use commands like mysqlcheck or REPAIR TABLE directly. We'll need to use offline repair tools.

Troubleshooting Steps (Offline Repair)

Step 1: Identify the Engine of the Corrupted Table

First, you need to know which engine the corrupted table uses (e.g., InnoDB, MyISAM, Aria).

  • If it's InnoDB: The recovery process will be different and usually involves innodb_force_recovery configurations.

  • If it's MyISAM or Aria: We'll use the respective myisamchk or aria_chk tools.

How to identify the engine when MySQL is down: Check the file extensions of the table in your database directory (usually /var/lib/mysql/database_name/).

  • MyISAM: Files with .MYI, .MYD, and .frm extensions.

  • Aria: Files with .MAI, .MAD, and .frm extensions.

Example: If your error refers to ./mysql/db, check its files:

ls -lh /var/lib/mysql/mysql/db.*

If you see files like db.MAD and db.MAI, this indicates an Aria table.

Step 2: Completely Stop the MySQL/MariaDB Service

This step is absolutely critical! Offline repair tools must not be run on a live database.

sudo systemctl stop mariadb # Or mysql if you're using MySQL
sudo systemctl disable mariadb # To prevent accidental restart
sudo systemctl mask mariadb # To further prevent restart

After running these commands, verify that no mysqld or mariadbd processes are running:

pgrep -a -f 'mysqld|mariadbd'

If you see any output, ensure you've successfully stopped the service.

Step 3: Run the Appropriate Repair Tool

Navigate to the directory containing the corrupted table files and run the repair tool.

  • For Aria tables (like mysql.db in the example):

    cd /var/lib/mysql/mysql
    sudo aria_chk -r db # The '-r' flag means "recover"
    

    You might see a message like "aria_chk: Got error 'Can't find file' when trying to use aria control file './aria_log_control'". This is often normal during recovery if the log is also affected; the tool will still proceed.

  • For MyISAM tables:

    sudo myisamchk -r /path/to/datadir/database_name/table_name.MYI
    # Or, if you've cd'd into the directory containing the table:
    # sudo myisamchk -r table_name
    

Step 4: Attempt to Restart MySQL/MariaDB

After the repair, try starting the service again:

sudo systemctl unmask mariadb # Or mysql
sudo systemctl start mariadb # Or mysql

Step 5: Handle Another Crashed Table (If Applicable)

If MySQL/MariaDB still doesn't start and the error log points to another crashed table (e.g., mysql.global_priv), you'll need to repeat the process:

  1. Stop the MySQL/MariaDB service.

  2. Identify the engine of the new corrupted table.

  3. Run the corresponding repair tool.

  4. Attempt to restart.

Step 6: Post-Repair Checks

Once MySQL/MariaDB starts successfully, you should perform a full check of all databases and tables to ensure no hidden errors remain:

mysqlcheck -Asc # Check All databases, Search for errors, Check tables

If this command reports further errors, you can try an online repair for specific databases or tables:

mysqlcheck -r database_name # Repair a specific database
mysqlcheck -r database_name table_name # Repair a specific table

Hopefully, this guide helps you effectively resolve the "Table is crashed and last repair failed" error. Remember to always back up your data regularly to avoid unexpected risks!