1195
MySQLERRORCommonTable / StorageHIGH confidence
Table is marked as crashed and last repair failed
Production Risk
Critical — table may be unrecoverable without a backup.
What this means
ER_CRASHED_ON_REPAIR (1195, SQLSTATE HY000) indicates that a MyISAM table was previously marked as crashed, an automatic repair was attempted, and that repair failed. The table remains inaccessible.
Why it happens
- 1Severe corruption that REPAIR TABLE could not resolve
- 2Disk errors preventing successful repair
- 3Insufficient disk space for temporary repair files
How to reproduce
trigger — this will error
trigger — this will error
SELECT * FROM badly_crashed_table;
expected output
ERROR 1195 (HY000): Table 'badly_crashed_table' is marked as crashed and last (automatic?) repair failed
Fix 1
Attempt manual repair with myisamchk
Attempt manual repair with myisamchk
-- Run from OS shell (stop MySQL first) myisamchk --recover --force /var/lib/mysql/dbname/tablename.MYI
Why this works
myisamchk provides more powerful repair options than the SQL REPAIR TABLE command.
Fix 2
Restore from backup if repair fails
Restore from backup if repair fails
-- Restore the .MYD and .MYI files from backup -- Then restart MySQL
Why this works
If the data file is too corrupt to repair, restoring from a known-good backup is the safest path.
Version notes
Sources
Official documentation ↗
MySQL 8.0 — 1195 ER_CRASHED_ON_REPAIR
Content generated with AI assistance and reviewed for accuracy. Found an error? hello@errcodes.dev