How to Fix MySQL Error 1195 (ER_CRASHED_ON_REPAIR)
You get mysql error 1195 when a database table crashes and automatic repair fails. To fix it, clear disk space, stop writes, and run an offline table repair. MySQL logs this event under symbol ER_CRASHED_ON_REPAIR and SQLSTATE HY000. The engine reports that the table is marked as crashed and last repair failed. Apps cannot read or write to that table until you fix the broken files. What causes mysql error 1195 in the database engine This failure occurs most often on older storage engines tha
Your coding agents run with your access.
Claude Code reaches prod with a developer's credentials, and approval prompts get clicked through. hoop.dev checks every query, masks sensitive data, and holds risky changes for a human.
You get mysql error 1195 when a database table crashes and automatic repair fails. To fix it, clear disk space, stop writes, and run an offline table repair.
MySQL logs this event under symbol ER_CRASHED_ON_REPAIR and SQLSTATE HY000. The engine reports that the table is marked as crashed and last repair failed. Apps cannot read or write to that table until you fix the broken files.
What causes mysql error 1195 in the database engine
This failure occurs most often on older storage engines that lack crash-safe transaction logs. When the host loses power or the server process dies mid-write, index files break. Upon restart, the server spots the dirty state and tries an automatic repair. If that background fix hits a roadblock, the engine raises mysql error 1195.
Disk exhaustion is the top culprit behind a failed repair job. During a table rebuild, the engine writes temporary sort files to the disk. If the volume fills up midway, the repair crashes and leaves the table unusable. You end up with a corrupted data file and a half-built index file.
File system permission mismatches also trigger this exact error message. If an admin copies data files as the root user, the database service loses write rights. Hardware disk errors and bad memory sectors can corrupt the index header as well.
How to diagnose and fix the failure in production
Start by checking your server error log and available disk space on all volumes. Look at both the main data folder and the temporary storage folder. Free up room on the host before you try any manual recovery steps. Make sure you have enough free space to hold a full copy of the table.
Next, copy the broken table files to a safe backup directory right away. Never run a repair tool before you save the raw files on disk. If the repair utility drops damaged rows, your backup copy protects you from data loss.
Single Sign-On (SSO) + MySQL Access Governance: architecture patterns and best practices
Continue reading? Get the full guide.
Free. No spam. Unsubscribe anytime.
Once your backup is safe, verify that the database system user owns every table file. Fix any broken file ownership rules on the host operating system. Then run a standard table check and repair through your database admin session. If online repair fails, stop the service and use the offline storage repair tool.
Do not grant broad host admin roles to every engineer during an outage. Use scoped roles and peer reviews before anyone runs repair tasks in production. Data masking also helps during checks by rewriting emails and card numbers in query results.
How to prevent future table repair crashes
The best long-term fix is to move away from non-transactional storage engines. Modern transactional engines use write-ahead logs to recover from sudden host crashes. They replay committed changes on startup and avoid manual index rebuilds.
Set up disk space alerts so your team knows before a volume fills up. Keep your temporary directory on a partition with plenty of spare capacity. Also, test your database backups each week so you can restore clean tables fast.
Add wire guardrails and masking beside MySQL
Database grants and TLS setup decide who can reach MySQL. Even so, an open session can run broad updates or read raw personal data from allowed tables. In practice, hoop.dev sits inline in the wire protocol beside the database as a sidecar for your MySQL. On every production query an agent or engineer sends, hoop.dev decides to pass, mask, block, or escalate it for human review.
With hoop.dev MySQL support, guardrails refuse bad queries before they run or hold risky calls for approval, while data masking rewrites matched sensitive values in result rows in memory. Furthermore, hoop.dev holds SOC 2 Type II and generates evidence for GDPR, HIPAA, and PCI DSS programs. Read the docs and source on GitHub.
Frequently asked questions
What does ER_CRASHED_ON_REPAIR mean in MySQL?
ER_CRASHED_ON_REPAIR is the system symbol for mysql error 1195 under SQLSTATE HY000. It means a table crashed and the prior repair attempt also failed.
Can a full disk cause mysql error 1195?
Yes, a full disk is the most common reason a table repair crashes. The engine needs free disk space to write temporary files while rebuilding broken indexes.
Will fixing a crashed table cause data loss?
Some forced repair modes can drop corrupted rows that the engine cannot read. Always back up the raw table files on disk before you start any repair.
Related guides
In this post