MySQL Troubleshooting Toolkit
Use this MySQL troubleshooting toolkit to diagnose too-many-connections, locks and deadlocks, replication lag, "server has gone away", and InnoDB issues.
Paste your error and get a triage plan.
Paste a log line, CLI error, stack trace, service failure, or config snippet and get a structured troubleshooting plan. Your snippet is carried straight into the AI Incident Response Assistant with MySQL context prefilled.
Do not paste secrets, tokens, private keys, passwords, or customer data. Your snippet stays in your browser until you open the assistant.
Top 25 MySQL Errors and Failure Modes
The production failures engineers hit most — each links to a full cause → fix → prevention guide.
Too many connections (ER 1040)
The server has reached max_connections and refuses new client sessions until existing ones close.
Access denied for user (1045)
Authentication failed because of a wrong password, missing grant, or host not matching the user account.
Can't connect to local MySQL server through socket (2002)
The client cannot reach the Unix socket, usually because mysqld is down or the socket path is wrong.
Can't connect to MySQL server on host (2003)
The TCP connection to the server failed due to a firewall, wrong port, bind-address, or a stopped daemon.
Lock wait timeout exceeded (1205)
A transaction waited longer than innodb_lock_wait_timeout for a row lock held by another transaction.
Deadlock found when trying to get lock (1213)
InnoDB detected two transactions waiting on each other's locks and rolled one back to break the cycle.
MySQL server has gone away (2006)
The connection dropped mid-query, often from wait_timeout, a large packet, or the server restarting.
Packet bigger than max_allowed_packet (1153)
A query or result exceeded max_allowed_packet, so the server aborted the oversized transfer.
The table is full (1114)
InnoDB could not extend the tablespace, typically from a full disk or an exhausted table size limit.
Got fatal error 1236 from source
A replica's IO thread stopped because the source's binary logs are missing, purged, or GTID state diverged.
Duplicate entry for key (1062)
An insert or update violated a unique or primary key constraint with a value that already exists.
Table doesn't exist (1146)
A query referenced a table that is missing, misspelled, or in a different database or case than expected.
Unknown column in field list (1054)
A query referenced a column that does not exist, often from a typo, alias scope, or a schema change.
Incorrect string value for column (1366)
A charset mismatch, such as inserting 4-byte emoji into a utf8 (not utf8mb4) column, rejected the value.
Aborted connection / Got an error reading communication packets
Clients disconnected without closing cleanly, from timeouts, network drops, or oversized packets.
Table is marked as crashed and should be repaired (1194)
A MyISAM or Aria table is corrupted and needs REPAIR TABLE before it can be read or written again.
Out of sort memory / sort aborted (1038)
A large ORDER BY or GROUP BY exceeded sort_buffer_size, so the sort operation failed.
The total number of locks exceeds the lock table size (1206)
A huge transaction ran InnoDB out of lock memory, usually from a bulk delete or update without batching.
Cannot add or update a child row: foreign key constraint fails (1452) guide coming soon
An insert or update referenced a parent key that does not exist, so the foreign key check rejected it.
Replication lag (high Seconds_Behind_Master) guide coming soon
A replica's SQL thread cannot keep pace with the source, leaving reads increasingly stale.
Out of memory / OOM killer terminates mysqld guide coming soon
Oversized buffers or too many connections exhausted RAM and the kernel killed the MySQL process.
InnoDB: Database page corruption / checksum mismatch guide coming soon
InnoDB detected a corrupt page on disk, often from bad hardware, and may refuse to start.
Too many open files (24) guide coming soon
MySQL hit the operating system file-descriptor limit and could not open more tables or connections.
The MySQL server is running with the --read-only option (1290) guide coming soon
A write was attempted against a read-only replica or a server put into read_only mode.
InnoDB log waits / redo log pressure guide coming soon
Write throughput stalled because the redo log filled faster than checkpoints could flush dirty pages.
Validate your config before you redeploy
Catch the structural mistakes that cause outages — 100% in your browser, nothing uploaded.
Best MySQL Prompts
Turn symptoms, logs, and config into a structured plan with prompts tuned for MySQL.
Download the MySQL Troubleshooting Runbook Pack
First-response checklists for MySQL/MariaDB — connections, locks, replication, and InnoDB.
- Too-many-connections & limits
- Locks & deadlock analysis
- Slow query & index review
- Replication status & lag
- InnoDB & disk-full recovery
All MySQL Troubleshooting Guides
Grouped by failure-mode type — each guide covers cause, fix, validation, and prevention.