5.8 Mapping MySQL Error Numbers to JDBC SQLState Codes

The table below provides a mapping of the MySQL error numbers to JDBC SQLState values.

Table 5.4 Mapping of MySQL Error Numbers to SQLStates

MySQL Error NumberMySQL Error NameLegacy (X/Open) SQLStateSQL Standard SQLState
1022ER_DUP_KEY2300023000
1037ER_OUTOFMEMORYS1001HY001
1038ER_OUT_OF_SORTMEMORYS1001HY001
1040ER_CON_COUNT_ERROR0800408004
1042ER_BAD_HOST_ERROR0800408S01
1043ER_HANDSHAKE_ERROR0800408S01
1044ER_DBACCESS_DENIED_ERROR4200042000
1045ER_ACCESS_DENIED_ERROR2800028000
1046ER_NO_DB_ERROR3D0003D000
1047ER_UNKNOWN_COM_ERROR08S0108S01
1048ER_BAD_NULL_ERROR2300023000
1049ER_BAD_DB_ERROR4200042000
1050ER_TABLE_EXISTS_ERROR42S0142S01
1051ER_BAD_TABLE_ERROR42S0242S02
1052ER_NON_UNIQ_ERROR2300023000
1053ER_SERVER_SHUTDOWN08S0108S01
1054ER_BAD_FIELD_ERRORS002242S22
1055ER_WRONG_FIELD_WITH_GROUPS100942000
1056ER_WRONG_GROUP_FIELDS100942000
1057ER_WRONG_SUM_SELECTS100942000
1058ER_WRONG_VALUE_COUNT21S0121S01
1059ER_TOO_LONG_IDENTS100942000
1060ER_DUP_FIELDNAMES100942S21
1061ER_DUP_KEYNAMES100942000
1062ER_DUP_ENTRYS100923000
1063ER_WRONG_FIELD_SPECS100942000
1064ER_PARSE_ERROR4200042000
1065ER_EMPTY_QUERY4200042000
1066ER_NONUNIQ_TABLES100942000
1067ER_INVALID_DEFAULTS100942000
1068ER_MULTIPLE_PRI_KEYS100942000
1069ER_TOO_MANY_KEYSS100942000
1070ER_TOO_MANY_KEY_PARTSS100942000
1071ER_TOO_LONG_KEYS100942000
1072ER_KEY_COLUMN_DOES_NOT_EXITSS100942000
1073ER_BLOB_USED_AS_KEYS100942000
1074ER_TOO_BIG_FIELDLENGTHS100942000
1075ER_WRONG_AUTO_KEYS100942000
1080ER_FORCING_CLOSE08S0108S01
1081ER_IPSOCK_ERROR08S0108S01
1082ER_NO_SUCH_INDEXS100942S12
1083ER_WRONG_FIELD_TERMINATORSS100942000
1084ER_BLOBS_AND_NO_TERMINATEDS100942000
1090ER_CANT_REMOVE_ALL_FIELDS4200042000
1091ER_CANT_DROP_FIELD_OR_KEY4200042000
1101ER_BLOB_CANT_HAVE_DEFAULT4200042000
1102ER_WRONG_DB_NAME4200042000
1103ER_WRONG_TABLE_NAME4200042000
1104ER_TOO_BIG_SELECT4200042000
1106ER_UNKNOWN_PROCEDURE4200042000
1107ER_WRONG_PARAMCOUNT_TO_PROCEDURE4200042000
1109ER_UNKNOWN_TABLE42S0242S02
1110ER_FIELD_SPECIFIED_TWICE4200042000
1112ER_UNSUPPORTED_EXTENSION4200042000
1113ER_TABLE_MUST_HAVE_COLUMNS4200042000
1115ER_UNKNOWN_CHARACTER_SET4200042000
1118ER_TOO_BIG_ROWSIZE4200042000
1120ER_WRONG_OUTER_JOIN4200042000
1121ER_NULL_COLUMN_IN_INDEX4200042000
1129ER_HOST_IS_BLOCKED08004HY000
1130ER_HOST_NOT_PRIVILEGED08004HY000
1131ER_PASSWORD_ANONYMOUS_USER4200042000
1132ER_PASSWORD_NOT_ALLOWED4200042000
1133ER_PASSWORD_NO_MATCH4200042000
1136ER_WRONG_VALUE_COUNT_ON_ROW21S0121S01
1138ER_INVALID_USE_OF_NULLS100042000
1139ER_REGEXP_ERROR4200042000
1140ER_MIX_OF_GROUP_FUNC_AND_FIELDS4200042000
1141ER_NONEXISTING_GRANT4200042000
1142ER_TABLEACCESS_DENIED_ERROR4200042000
1143ER_COLUMNACCESS_DENIED_ERROR4200042000
1144ER_ILLEGAL_GRANT_FOR_TABLE4200042000
1145ER_GRANT_WRONG_HOST_OR_USER4200042000
1146ER_NO_SUCH_TABLE42S0242S02
1147ER_NONEXISTING_TABLE_GRANT4200042000
1148ER_NOT_ALLOWED_COMMAND4200042000
1149ER_SYNTAX_ERROR4200042000
1152ER_ABORTING_CONNECTION08S0108S01
1153ER_NET_PACKET_TOO_LARGE08S0108S01
1154ER_NET_READ_ERROR_FROM_PIPE08S0108S01
1155ER_NET_FCNTL_ERROR08S0108S01
1156ER_NET_PACKETS_OUT_OF_ORDER08S0108S01
1157ER_NET_UNCOMPRESS_ERROR08S0108S01
1158ER_NET_READ_ERROR08S0108S01
1159ER_NET_READ_INTERRUPTED08S0108S01
1160ER_NET_ERROR_ON_WRITE08S0108S01
1161ER_NET_WRITE_INTERRUPTED08S0108S01
1162ER_TOO_LONG_STRING4200042000
1163ER_TABLE_CANT_HANDLE_BLOB4200042000
1164ER_TABLE_CANT_HANDLE_AUTO_INCREMENT4200042000
1166ER_WRONG_COLUMN_NAME4200042000
1167ER_WRONG_KEY_COLUMN4200042000
1169ER_DUP_UNIQUE2300023000
1170ER_BLOB_KEY_WITHOUT_LENGTH4200042000
1171ER_PRIMARY_CANT_HAVE_NULL4200042000
1172ER_TOO_MANY_ROWS4200042000
1173ER_REQUIRES_PRIMARY_KEY4200042000
1176ER_KEY_DOES_NOT_EXITS4200042000
1177ER_CHECK_NO_SUCH_TABLE4200042000
1178ER_CHECK_NOT_IMPLEMENTED4200042000
1179ER_CANT_DO_THIS_DURING_AN_TRANSACTION2500025000
1184ER_NEW_ABORTING_CONNECTION08S0108S01
1189ER_MASTER_NET_READ08S0108S01
1190ER_MASTER_NET_WRITE08S0108S01
1203ER_TOO_MANY_USER_CONNECTIONS4200042000
1205ER_LOCK_WAIT_TIMEOUT4100041000
1207ER_READ_ONLY_TRANSACTION2500025000
1211ER_NO_PERMISSION_TO_CREATE_USER4200042000
1213ER_LOCK_DEADLOCK4100041000
1216ER_NO_REFERENCED_ROW2300023000
1217ER_ROW_IS_REFERENCED2300023000
1218ER_CONNECT_TO_MASTER08S0108S01
1222ER_WRONG_NUMBER_OF_COLUMNS_IN_SELECT2100021000
1226ER_USER_LIMIT_REACHED4200042000
1227ER_SPECIFIC_ACCESS_DENIED_ERROR4200042000
1230ER_NO_DEFAULT4200042000
1231ER_WRONG_VALUE_FOR_VAR4200042000
1232ER_WRONG_TYPE_FOR_VAR4200042000
1234ER_CANT_USE_OPTION_HERE4200042000
1235ER_NOT_SUPPORTED_YET4200042000
1239ER_WRONG_FK_DEF4200042000
1241ER_OPERAND_COLUMNS2100021000
1242ER_SUBQUERY_NO_1_ROW2100021000
1247ER_ILLEGAL_REFERENCE42S2242S22
1248ER_DERIVED_MUST_HAVE_ALIAS4200042000
1249ER_SELECT_REDUCED0100001000
1250ER_TABLENAME_NOT_ALLOWED_HERE4200042000
1251ER_NOT_SUPPORTED_AUTH_MODE0800408004
1252ER_SPATIAL_CANT_HAVE_NULL4200042000
1253ER_COLLATION_CHARSET_MISMATCH4200042000
1261ER_WARN_TOO_FEW_RECORDS0100001000
1262ER_WARN_TOO_MANY_RECORDS0100001000
1263ER_WARN_NULL_TO_NOTNULLS100001000
1264ER_WARN_DATA_OUT_OF_RANGE0100001000
1265ER_WARN_DATA_TRUNCATED0100001000
1280ER_WRONG_NAME_FOR_INDEX4200042000
1281ER_WRONG_NAME_FOR_CATALOG4200042000
1286ER_UNKNOWN_STORAGE_ENGINE4200042000
1292ER_TRUNCATED_WRONG_VALUE2200722007
1303ER_SP_NO_RECURSIVE_CREATES10002F003
1304ER_SP_ALREADY_EXISTS4200042000
1305ER_SP_DOES_NOT_EXIST4200042000
1308ER_SP_LILABEL_MISMATCH4200042000
1309ER_SP_LABEL_REDEFINE4200042000
1310ER_SP_LABEL_MISMATCH4200042000
1311ER_SP_UNINIT_VAR0100001000
1312ER_SP_BADSELECT0A0000A000
1313ER_SP_BADRETURN4200042000
1314ER_SP_BADSTATEMENT0A0000A000
1315ER_UPDATE_LOG_DEPRECATED_IGNORED4200042000
1316ER_UPDATE_LOG_DEPRECATED_TRANSLATED4200042000
1317ER_QUERY_INTERRUPTEDS100070100
1318ER_SP_WRONG_NO_OF_ARGS4200042000
1319ER_SP_COND_MISMATCH4200042000
1320ER_SP_NORETURN4200042000
1321ER_SP_NORETURNENDS10002F005
1322ER_SP_BAD_CURSOR_QUERY4200042000
1323ER_SP_BAD_CURSOR_SELECT4200042000
1324ER_SP_CURSOR_MISMATCH4200042000
1325ER_SP_CURSOR_ALREADY_OPEN2400024000
1326ER_SP_CURSOR_NOT_OPEN2400024000
1327ER_SP_UNDECLARED_VAR4200042000
1329ER_SP_FETCH_NO_DATAS100002000
1330ER_SP_DUP_PARAM4200042000
1331ER_SP_DUP_VAR4200042000
1332ER_SP_DUP_COND4200042000
1333ER_SP_DUP_CURS4200042000
1335ER_SP_SUBSELECT_NYI0A0000A000
1336ER_STMT_NOT_ALLOWED_IN_SF_OR_TRG0A0000A000
1337ER_SP_VARCOND_AFTER_CURSHNDLR4200042000
1338ER_SP_CURSOR_AFTER_HANDLER4200042000
1339ER_SP_CASE_NOT_FOUNDS100020000
1365ER_DIVISION_BY_ZERO2201222012
1367ER_ILLEGAL_VALUE_FOR_TYPE2200722007
1370ER_PROCACCESS_DENIED_ERROR4200042000
1397ER_XAER_NOTAS1000XAE04
1398ER_XAER_INVALS1000XAE05
1399ER_XAER_RMFAILS1000XAE07
1400ER_XAER_OUTSIDES1000XAE09
1401ER_XA_RMERRS1000XAE03
1402ER_XA_RBROLLBACKS1000XA100
1403ER_NONEXISTING_PROC_GRANT4200042000
1406ER_DATA_TOO_LONG2200122001
1407ER_SP_BAD_SQLSTATE4200042000
1410ER_CANT_CREATE_USER_WITH_GRANT4200042000
1413ER_SP_DUP_HANDLER4200042000
1414ER_SP_NOT_VAR_ARG4200042000
1415ER_SP_NO_RETSET0A0000A000
1416ER_CANT_CREATE_GEOMETRY_OBJECT2200322003
1425ER_TOO_BIG_SCALE4200042000
1426ER_TOO_BIG_PRECISION4200042000
1427ER_M_BIGGER_THAN_D4200042000
1437ER_TOO_LONG_BODY4200042000
1439ER_TOO_BIG_DISPLAYWIDTH4200042000
1440ER_XAER_DUPIDS1000XAE08
1441ER_DATETIME_FUNCTION_OVERFLOW2200822008
1451ER_ROW_IS_REFERENCED_22300023000
1452ER_NO_REFERENCED_ROW_22300023000
1453ER_SP_BAD_VAR_SHADOW4200042000
1458ER_SP_WRONG_NAME4200042000
1460ER_SP_NO_AGGREGATE4200042000
1461ER_MAX_PREPARED_STMT_COUNT_REACHED4200042000
1463ER_NON_GROUPING_FIELD_USED4200042000
1557ER_FOREIGN_DUPLICATE_KEY2300023000
1568ER_CANT_CHANGE_TX_ISOLATIONS100025001
1582ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT4200042000
1583ER_WRONG_PARAMETERS_TO_NATIVE_FCT4200042000
1584ER_WRONG_PARAMETERS_TO_STORED_FCT4200042000
1586ER_DUP_ENTRY_WITH_KEY_NAME2300023000
1613ER_XA_RBTIMEOUTS1000XA106
1614ER_XA_RBDEADLOCKS1000XA102
1630ER_FUNC_INEXISTENT_NAME_COLLISION4200042000
1641ER_DUP_SIGNAL_SET4200042000
1642ER_SIGNAL_WARN0100001000
1643ER_SIGNAL_NOT_FOUNDS100002000
1645ER_RESIGNAL_WITHOUT_ACTIVE_HANDLERS10000K000
1687ER_SPATIAL_MUST_HAVE_GEOM_COL4200042000
1690ER_DATA_OUT_OF_RANGE2200322003
1698ER_ACCESS_DENIED_NO_PASSWORD_ERROR2800028000
1701ER_TRUNCATE_ILLEGAL_FK4200042000
1758ER_DA_INVALID_CONDITION_NUMBER3500035000
1761ER_FOREIGN_DUPLICATE_KEY_WITH_CHILD_INFO2300023000
1762ER_FOREIGN_DUPLICATE_KEY_WITHOUT_CHILD_INFO2300023000
1792ER_CANT_EXECUTE_IN_READ_ONLY_TRANSACTIONS100025006
1845ER_ALTER_OPERATION_NOT_SUPPORTED0A0000A000
1846ER_ALTER_OPERATION_NOT_SUPPORTED_REASON0A0000A000
1859ER_DUP_UNKNOWN_IN_INDEX2300023000
1873ER_ACCESS_DENIED_CHANGE_USER_ERROR2800028000
1887ER_GET_STACKED_DA_WITHOUT_ACTIVE_HANDLERS10000Z002
1903ER_INVALID_ARGUMENT_FOR_LOGARITHMS10002201E