Database error codes
Paste an error number, a SQLSTATE or a few words of the message. Each entry gives the exact message text, what it means in plain words, the usual causes and a step-by-step fix with SQL.
Browse by database
SQL Server
94 error numbers, 94 explained in full.
SQL Server error codes →PostgreSQL
262 sqlstates, 63 explained in full.
PostgreSQL error codes →MySQL
79 error numbers, 79 explained in full.
MySQL error codes →SQLite
105 result codes, 40 explained in full.
SQLite error codes →Oracle
71 error codes, 71 explained in full.
Oracle error codes →Most searched errors
18456SQL Server: Login failed for user266SQL Server: Transaction count mismatch after EXECUTE1205SQL Server: Deadlocked and chosen as the victim2627SQL Server: Violation of PRIMARY KEY or UNIQUE KEY547SQL Server: Statement conflicted with a constraint8152SQL Server: String or binary data truncated208SQL Server: Invalid object name4060SQL Server: Cannot open database requested42P01PostgreSQL: relation does not exist23505PostgreSQL: duplicate key violates unique constraint40P01PostgreSQL: deadlock detected25P02PostgreSQL: current transaction is aborted42703PostgreSQL: column does not exist28P01PostgreSQL: password authentication failed1045MySQL: Access denied for user1062MySQL: Duplicate entry for key1064MySQL: You have an error in your SQL syntax1452MySQL: Foreign key fails: cannot add child row2002MySQL: Can't connect through socket1213MySQL: Deadlock found when trying to get lockSQLITE_BUSYSQLite: database is lockedSQLITE_CONSTRAINTSQLite: constraint failedSQLITE_LOCKEDSQLite: database table is lockedORA-00942Oracle: table or view does not existORA-01017Oracle: invalid username/password; logon deniedORA-12154Oracle: TNS: could not resolve the connect identifierORA-00001Oracle: unique constraint violated
Same problem, different code
Every database reports the same everyday failures under its own code. If you know the error on one engine, this is where to find it on the others.
| Problem | SQL Server | PostgreSQL | MySQL | SQLite | Oracle |
|---|---|---|---|---|---|
| Duplicate key (unique violation) |
2627
|
23505
|
1062
|
SQLITE_CONSTRAINT_UNIQUE
|
ORA-00001
|
| Foreign key violation |
547
|
23503
|
1452
|
SQLITE_CONSTRAINT_FOREIGNKEY
|
ORA-02291
|
| NOT NULL violation |
515
|
23502
|
1048
|
SQLITE_CONSTRAINT_NOTNULL
|
ORA-01400
|
| Table or view does not exist |
208
|
42P01
|
1146
|
— |
ORA-00942
|
| Unknown column |
207
|
42703
|
1054
|
— |
ORA-00904
|
| Deadlock |
1205
|
40P01
|
1213
|
— |
ORA-00060
|
| Login or password rejected |
18456
|
28P01
|
1045
|
— |
ORA-01017
|
| Value too long for column |
8152
|
22001
|
1406
|
— |
ORA-12899
|
| Lock wait timed out / database busy |
1222
|
55P03
|
1205
|
SQLITE_BUSY
|
ORA-00054
|
Database error FAQ
What is the difference between an error number and a SQLSTATE?
An error number is the vendor’s own code, such as SQL Server 2627 or MySQL 1062. A SQLSTATE is the five-character code from the SQL standard, such as 23505 for a unique violation in PostgreSQL. PostgreSQL reports SQLSTATEs as its main code; MySQL reports both; SQL Server drivers map its numbers to SQLSTATEs through ODBC and JDBC.
Where do the error messages on these pages come from?
From each vendor’s official documentation: Microsoft’s Database Engine events and errors reference, the PostgreSQL error codes appendix, the MySQL server and client error references, the SQLite result codes page and Oracle’s database error messages. Each page links its source.
Does searching send my error message anywhere?
No. With JavaScript on, the search runs in your browser over a list of codes downloaded with the page, so what you type stays on your device. Only with JavaScript turned off does the search box fall back to an ordinary form that asks the server for matches.
One SQL client for every database here
SQLly connects to SQL Server, PostgreSQL, MySQL, SQLite, Oracle and more from one native app for macOS, Windows and Linux.