Can't find record in table
Production Risk
High — indicates possible data corruption or replication divergence.
ER_KEY_NOT_FOUND (1032, SQLSTATE HY000) is raised when the storage engine cannot locate a row by its key during an UPDATE or DELETE. It often indicates table corruption or replication divergence.
- 1Table data is corrupt — index and row data are out of sync
- 2Replication applied an UPDATE/DELETE for a row that does not exist on the replica
- 3Manual row deletion bypassed the storage engine
-- Typically seen during replication or after table corruption
expected output
ERROR 1032 (HY000): Can't find record in 'tablename'
Fix 1
Check and repair the table
WHEN Error occurs outside of replication context.
CHECK TABLE tablename; REPAIR TABLE tablename;
Why this works
CHECK TABLE identifies corruption; REPAIR TABLE rebuilds the index to match the data file.
Fix 2
Skip or handle the replication error
WHEN Error appears on a replica during replication.
-- For a single skipped event (use with care): STOP SLAVE; SET GLOBAL SQL_SLAVE_SKIP_COUNTER = 1; START SLAVE;
Why this works
Skipping a single event lets replication continue, but investigate why the row was missing.
✕ Skip replication errors repeatedly without investigation
Repeated 1032 errors on a replica indicate the replica is diverging from the source; skipping compounds the data drift.
MySQL 8.0 — 1032 ER_KEY_NOT_FOUND
Content generated with AI assistance and reviewed for accuracy. Found an error? hello@errcodes.dev