MySQL Error Codes: Complete reference of MySQL 8.0 server error codes (numeric codes like… Searchable index with fixes, code examples, and official sources.
MySQL reports errors with a numeric code plus a SQLSTATE. The code tells you which subsystem failed — 1xxx codes cover connection and authentication, 10xx–11xx cover SQL parsing and schema lookups, 12xx cover locking and transactions, and 13xx–14xx cover constraint enforcement on writes. Each page below pairs the official message with the concrete statement that triggers it and a fix you can paste into a migration or a retry loop.