> For the complete documentation index, see [llms.txt](https://mariadb.com/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://mariadb.com/docs/server/reference/error-codes/mariadb-error-codes-1100-to-1199/e1194.md).

# Error 1194: Table is marked as crashed and should be repaired

| Error Code | SQLSTATE | Error                  | Description                                            |
| ---------- | -------- | ---------------------- | ------------------------------------------------------ |
| 1194       | HY000    | ER\_CRASHED\_ON\_USAGE | Table '%s' is marked as crashed and should be repaired |

## Possible Causes and Solutions

This error occurs, in particular to [MyISAM](/docs/server/server-usage/storage-engines/myisam-storage-engine.md), [Aria](/docs/server/server-usage/storage-engines/aria.md), [Archive](/docs/server/server-usage/storage-engines/archive.md) or [CSV](/docs/server/server-usage/storage-engines/csv.md) tables, if the table is marked as crashed. This can occur for a number of reasons, for example:

* running out of disk space
* sudden shutdown while the table was in use
* damage to the table's data or index files, for example by a storage problem or by a program that changed the files while the server used them

InnoDB tables recover from a crash with InnoDB's own crash recovery when the server starts, and don't get marked as crashed. InnoDB returns this error only when the table definition and InnoDB's data dictionary don't agree on the number of columns. The error log then says `Table … contains N user defined columns in InnoDB, but M columns in MariaDB`. `REPAIR TABLE` doesn't help in that case. See [InnoDB Data Dictionary Troubleshooting](/docs/server/server-usage/storage-engines/innodb/innodb-troubleshooting/innodb-data-dictionary-troubleshooting.md).

When the server opens a MyISAM or Aria table that is marked as crashed, it first tries to repair it, as set by [myisam\_recover\_options](/docs/server/server-usage/storage-engines/myisam-storage-engine/myisam-system-variables.md#myisam_recover_options) and [aria\_recover\_options](/docs/server/server-usage/storage-engines/aria/aria-system-variables.md#aria_recover_options). Both default to `BACKUP,QUICK`. A quick repair can't fix a damaged data file, so the statement then fails with this error, and the [error log](/docs/server/server-management/server-monitoring-logs/error-log.md) shows the attempt:

```
[ERROR] mariadbd: Table './shop/m1' is marked as crashed and should be repaired
[Warning] Checking table:   './shop/m1'
[Warning] Recovering table: './shop/m1'
[ERROR] Couldn't repair table: shop.m1
```

To solve the error:

* Run [CHECK TABLE](/docs/server/reference/sql-statements/table-statements/check-table.md) to see what is damaged, then [REPAIR TABLE](/docs/server/reference/sql-statements/table-statements/repair-table.md). Outside the server, the same can be done with [mariadb-check](/docs/server/clients-and-utilities/table-tools/mariadb-check.md), or, with the server stopped or the table locked, with [myisamchk](/docs/server/clients-and-utilities/myisam-clients-and-utilities/myisamchk.md) or [aria\_chk](/docs/server/clients-and-utilities/aria-clients-and-utilities/aria_chk.md).
* Check the warnings of `REPAIR TABLE`. When the data file is damaged, the repair keeps only the rows it can read, and reports how many there are. For example, `Number of rows changed from 2000 to 500`. If the lost rows matter, restore the table from a backup instead.
* Find the cause, for example a full disk or an unclean shutdown, so that the table doesn't crash again. For data that must survive a crash, consider InnoDB, or a [transactional](/docs/server/server-usage/storage-engines/aria/aria-storage-formats.md) Aria table.

Related errors: a damaged index gives [error 1034](/docs/server/reference/error-codes/mariadb-error-codes-1000-to-1099/e1034.md) (`Index for table … is corrupt; try to repair it`), and a table whose last repair failed or was interrupted gives [error 1195](/docs/server/reference/error-codes/mariadb-error-codes-1100-to-1199/e1195.md) (`Table … is marked as crashed and last (automatic?) repair failed`).

<sub>*This page is licensed: CC BY-SA / Gnu FDL*</sub>

{% @marketo/form formId="4316" %}
