MySQL error codes
26 codes — tap one for its meaning, causes, and fix steps.
- 1040Too many connections — the server has reached its connection limit
- 1044Access denied for user to database — missing GRANT
- 1045Access denied for user — wrong credentials
- 1048Column cannot be null — a required column received a NULL
- 1050Table already exists — CREATE TABLE failed because the name is taken
- 1051Unknown table — a DROP or query referenced a table that does not exist
- 1054Unknown column — the column name is not defined on the table
- 1062Duplicate entry for key — unique constraint violated
- 1064SQL syntax error — the query contains invalid SQL
- 1136Column count does not match value count — INSERT column and value lists differ
- 1146Table does not exist — the named table is missing
- 1205Lock wait timeout exceeded — a lock could not be acquired in time
- 1213Deadlock found when trying to get lock — two transactions blocked each other
- 1216Cannot add a child row — foreign key constraint fails on INSERT
- 1217Cannot delete a parent row — foreign key constraint prevents DELETE
- 1227Access denied — insufficient privilege for the requested operation
- 1264Out of range value for column — a number exceeds the column's storage type
- 1305Procedure or function does not exist — the named routine is missing
- 1366Incorrect integer value — a non-numeric string was stored in an integer column
- 1406Data too long for column — string exceeds column size
- 1451Cannot delete or update parent row — a child row exists
- 1452Cannot add or update a child row — foreign key constraint fails
- 2002Can't connect to local MySQL server through socket — the socket file is missing
- 2003Can't connect to MySQL server on host — connection refused or host unreachable
- 2006MySQL server has gone away — the server closed the connection mid-query
- 2013Lost connection to MySQL server during query — connection dropped while a query was running