MySQL & MariaDB errors, explained and tested on every version
Type the error number or paste the message. Every page says which versions it applies to, and the fixes are run on real servers.
6,925error codes
9server versions tested
66tested guides
57releases parsed
Most searched errors
1045 explained ER_ACCESS_DENIED_ERROR Access denied for user '…'@'…' (using password: …) 1064 explained ER_PARSE_ERROR You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '…' at line … 1062 explained ER_DUP_ENTRY Duplicate entry '…' for key … 2002 explained CR_CONNECTION_ERROR Can't connect to local MySQL server through socket '…' (…) 2013 explained CR_SERVER_LOST Lost connection to MySQL server during query 1452 explained ER_NO_REFERENCED_ROW_2 Cannot add or update a child row: a foreign key constraint fails… 1366 explained ER_TRUNCATED_WRONG_VALUE_FOR_FIELD Incorrect … value: '…' for column '…' at row … 1406 explained ER_DATA_TOO_LONG Data too long for column '…' at row … 1146 explained ER_NO_SUCH_TABLE Table '….…' doesn't exist 1205 explained ER_LOCK_WAIT_TIMEOUT Lock wait timeout exceeded; try restarting transaction 3948 explained ER_CLIENT_LOCAL_FILES_DISABLED Loading local data is disabled; this must be enabled on both the client and server sides 1418 explained ER_BINLOG_UNSAFE_ROUTINE This function has none of DETERMINISTIC, NO SQL, or READS SQL DATA in its declaration and binary logging is enabled (you *might* want to use the less safe log_bin_trust_function_creators variable)
What our version tests found
MariaDB 10.11.17+ loses rows
ALTER IGNORE TABLE … ADD PRIMARY KEY deletes every duplicated row instead of keeping one. Reported as MDEV-42382.
27 new reserved words in MySQL 8.0
AS rank, rows, groups, function now fail with 1064. See which words change on upgrade.
Same number, different error
165 error numbers mean different things in MySQL and MariaDB, mostly 4000–4999. Example: 4025.
utf8mb4 breaks fixed-width loads
LOAD DATA … FIELDS TERMINATED BY '' fails with 1406 on any utf8mb4 table, the default since MySQL 8.0.
Guides with version tables
- Adding unique constraintbehaves differently by version
- Update rank on a tablebehaves differently by version
- Import fixed width/row formatbehaves differently by version
- Copying a database, users and privileges between two serversbehaves differently by version
- Minimum privileges to take a backupbehaves differently by version
- LOAD DATA INFILEbehaves differently by version