连接器和 API 手册  / 第 3 章 MySQL Connector/J 开发人员指南  / 3.5 连接器/J 参考  /  3.5.16 将 MySQL 错误号映射到 JDBC SQLState 代码

3.5.16 将 MySQL 错误号映射到 JDBC SQLState 代码

下表提供了 MySQL 错误号到 JDBCSQLState值的映射。

表 3.27 MySQL 错误号到 SQLState 的映射

MySQL 错误号MySQL 错误名称SQL 标准 SQLState
1022ER_DUP_KEY23000
1037ER_OUTOFMEMORYHY001
1038ER_OUT_OF_SORTMEMORYHY001
1040ER_CON_COUNT_ERROR08004
1042ER_BAD_HOST_ERROR08S01
1043ER_HANDSHAKE_ERROR 错误08S01
1044ER_DBACCESS_DENIED_ERROR42000
1045ER_ACCESS_DENIED_ERROR28000
1046ER_NO_DB_ERROR3D000
1047ER_UNKNOWN_COM_ERROR08S01
1048ER_BAD_NULL_ERROR23000
1049ER_BAD_DB_ERROR42000
1050ER_TABLE_EXISTS_ERROR42S01
1051ER_BAD_TABLE_ERROR42S02
1052ER_NON_UNIQ_ERROR23000
1053ER_SERVER_SHUTDOWN08S01
1054ER_BAD_FIELD_ERROR42S22
1055ER_WRONG_FIELD_WITH_GROUP42000
1056ER_WRONG_GROUP_FIELD42000
1057ER_WRONG_SUM_SELECT42000
1058ER_WRONG_VALUE_COUNT21S01
1059ER_TOO_LONG_IDENT42000
1060ER_DUP_FIELDNAME42S21
1061ER_DUP_KEYNAME42000
1062ER_DUP_ENTRY23000
1063ER_WRONG_FIELD_SPEC42000
1064ER_PARSE_ERROR42000
1065ER_EMPTY_QUERY42000
1066ER_NONUNIQ_TABLE42000
1067ER_INVALID_DEFAULT42000
1068ER_MULTIPLE_PRI_KEY42000
1069ER_TOO_MANY_KEYS42000
1070ER_TOO_MANY_KEY_PARTS42000
1071ER_TOO_LONG_KEY42000
1072ER_KEY_COLUMN_DOES_NOT_EXITS42000
1073ER_BLOB_USED_AS_KEY42000
1074ER_TOO_BIG_FIELDLENGTH42000
1075ER_WRONG_AUTO_KEY42000
1080ER_FORCING_CLOSE08S01
1081ER_IPSOCK_错误08S01
1082ER_NO_SUCH_INDEX42S12
1083ER_WRONG_FIELD_TERMINATORS42000
1084ER_BLOBS_AND_NO_TERMINATED42000
1090ER_CANT_REMOVE_ALL_FIELDS42000
1091ER_CANT_DROP_FIELD_OR_KEY42000
1101ER_BLOB_CANT_HAVE_DEFAULT42000
1102ER_WRONG_DB_NAME42000
1103ER_WRONG_TABLE_NAME42000
1104ER_TOO_BIG_SELECT42000
1106ER_UNKNOWN_PROCEDURE42000
1107ER_WRONG_PARAMCOUNT_TO_PROCEDURE42000
1109ER_UNKNOWN_TABLE42S02
1110ER_FIELD_SPECIFIED_TWICE42000
1112ER_UNSUPPORTED_EXTENSION42000
1113ER_TABLE_MUST_HAVE_COLUMNS42000
1115ER_UNKNOWN_CHARACTER_SET42000
1118ER_TOO_BIG_ROWSIZE42000
1120ER_WRONG_OUTER_JOIN42000
1121ER_NULL_COLUMN_IN_INDEX42000
1131ER_PASSWORD_ANONYMOUS_USER42000
1132ER_PASSWORD_NOT_ALLOWED42000
1133ER_PASSWORD_NO_MATCH42000
1136ER_WRONG_VALUE_COUNT_ON_ROW21S01
1138ER_INVALID_USE_OF_NULL22004
1139ER_REGEXP_ERROR42000
1140ER_MIX_OF_GROUP_FUNC_AND_FIELDS42000
1141ER_NONEXISTING_GRANT42000
1142ER_TABLEACCESS_DENIED_ERROR42000
1143ER_COLUMNACCESS_DENIED_ERROR42000
1144ER_ILLEGAL_GRANT_FOR_TABLE42000
1145ER_GRANT_WRONG_HOST_OR_USER42000
1146ER_NO_SUCH_TABLE42S02
1147ER_NONEXISTING_TABLE_GRANT42000
1148ER_NOT_ALLOWED_COMMAND42000
1149ER_SYNTAX_ERROR42000
1152ER_ABORTING_CONNECTION08S01
1153ER_NET_PACKET_TOO_LARGE08S01
1154ER_NET_READ_ERROR_FROM_PIPE08S01
1155ER_NET_FCNTL_ERROR08S01
1156ER_NET_PACKETS_OUT_OF_ORDER08S01
1157ER_NET_UNCOMPRESS_ERROR08S01
1158ER_NET_READ_ERROR08S01
1159ER_NET_READ_INTERRUPTED08S01
1160ER_NET_ERROR_ON_WRITE08S01
1161ER_NET_WRITE_INTERRUPTED08S01
1162ER_TOO_LONG_STRING42000
1163ER_TABLE_CANT_HANDLE_BLOB42000
1164ER_TABLE_CANT_HANDLE_AUTO_INCREMENT42000
1166ER_WRONG_COLUMN_NAME42000
1167ER_WRONG_KEY_COLUMN42000
1169ER_DUP_UNIQUE23000
1170ER_BLOB_KEY_WITHOUT_LENGTH42000
1171ER_PRIMARY_CANT_HAVE_NULL42000
1172ER_TOO_MANY_ROWS42000
1173ER_REQUIRES_PRIMARY_KEY42000
1176ER_KEY_DOES_NOT_EXITS42000
1177ER_CHECK_NO_SUCH_TABLE42000
1178ER_CHECK_NOT_IMPLEMENTED42000
1179ER_CANT_DO_THIS_DURING_AN_TRANSACTION25000
1184ER_NEW_ABORTING_CONNECTION08S01
1189ER_SOURCE_NET_READ08S01
1190ER_SOURCE_NET_WRITE08S01
1203ER_TOO_MANY_USER_CONNECTIONS42000
1205ER_LOCK_WAIT_TIMEOUT40001
1207ER_READ_ONLY_TRANSACTION 交易25000
1211ER_NO_PERMISSION_TO_CREATE_USER42000
1213ER_LOCK_DEADLOCK40001
1216ER_NO_REFERENCED_ROW23000
1217ER_ROW_IS_REFERENCED23000
1218ER_CONNECT_TO_SOURCE08S01
1222ER_WRONG_NUMBER_OF_COLUMNS_IN_SELECT21000
1226ER_USER_LIMIT_REACHED42000
1227ER_SPECIFIC_ACCESS_DENIED_ERROR42000
1230ER_NO_DEFAULT42000
1231ER_WRONG_VALUE_FOR_VAR42000
1232ER_WRONG_TYPE_FOR_VAR42000
1234ER_CANT_USE_OPTION_HERE42000
1235ER_NOT_SUPPORTED_YET42000
1239ER_WRONG_FK_DEF42000
1241ER_OPERAND_COLUMNS21000
1242ER_SUBQUERY_NO_1_ROW21000
1247ER_ILLEGAL_REFERENCE42S22
1248ER_DERIVED_MUST_HAVE_ALIAS42000
1249ER_SELECT_REDUCED01000
1250ER_TABLENAME_NOT_ALLOWED_HERE42000
1251ER_NOT_SUPPORTED_AUTH_MODE08004
1252ER_SPATIAL_CANT_HAVE_NULL42000
1253ER_COLLATION_CHARSET_MISMATCH42000
1261ER_WARN_TOO_FEW_RECORDS01000
1262ER_WARN_TOO_MANY_RECORDS01000
1263ER_WARN_NULL_TO_NOTNULL22004
1264ER_WARN_DATA_OUT_OF_RANGE22003
1265ER_WARN_DATA_TRUNCATED01000
1280ER_WRONG_NAME_FOR_INDEX42000
1281ER_WRONG_NAME_FOR_CATALOG42000
1286ER_UNKNOWN_STORAGE_ENGINE42000
1292ER_TRUNCATED_WRONG_VALUE22007
1303ER_SP_NO_RECURSIVE_CREATE2F003
1304ER_SP_ALREADY_EXISTS42000
1305ER_SP_DOES_NOT_EXIST42000
1308ER_SP_LILABEL_MISMATCH42000
1309ER_SP_LABEL_REDEFINE42000
1310ER_SP_LABEL_MISMATCH42000
1311ER_SP_UNINIT_VAR01000
1312ER_SP_BADSELECT0A000
1313ER_SP_BADRETURN42000
1314ER_SP_BADSTATEMENT0A000
1315ER_UPDATE_LOG_DEPRECATED_IGNORED42000
1316ER_UPDATE_LOG_DEPRECATED_TRANSLATED42000
1317ER_QUERY_INTERRUPTED70100
1318ER_SP_WRONG_NO_OF_ARGS42000
1319ER_SP_COND_MISMATCH42000
1320ER_SP_NORETURN42000
1321ER_SP_NORETURNEND2F005
1322ER_SP_BAD_CURSOR_QUERY42000
1323ER_SP_BAD_CURSOR_SELECT42000
1324ER_SP_CURSOR_MISMATCH42000
1325ER_SP_CURSOR_ALREADY_OPEN24000
1326ER_SP_CURSOR_NOT_OPEN24000
1327ER_SP_UNDECLARED_VAR42000
1329ER_SP_FETCH_NO_DATA02000
1330ER_SP_DUP_PARAM42000
1331ER_SP_DUP_VAR42000
1332ER_SP_DUP_COND42000
1333ER_SP_DUP_CURS42000
1335ER_SP_SUBSELECT_NYI0A000
1336ER_STMT_NOT_ALLOWED_IN_SF_OR_TRG0A000
1337ER_SP_VARCOND_AFTER_CURSHNDLR42000
1338ER_SP_CURSOR_AFTER_HANDLER42000
1339ER_SP_CASE_NOT_FOUND20000
1365ER_DIVISION_BY_ZERO22012
1367ER_ILLEGAL_VALUE_FOR_TYPE22007
1370ER_PROCACCESS_DENIED_ERROR42000
1397ER_XAER_NOTAXAE04
1398ER_XAER_INVALXAE05
1399ER_XAER_RMFAILXAE07
1400ER_XAER_OUTSIDEXAE09
1401ER_XA_RMERRXAE03
1402ER_XA_RBROLLBACKXA100
1403ER_NONEXISTING_PROC_GRANT42000
1406ER_DATA_TOO_LONG22001
1407ER_SP_BAD_SQLSTATE42000
1410ER_CANT_CREATE_USER_WITH_GRANT42000
1413ER_SP_DUP_HANDLER42000
1414ER_SP_NOT_VAR_ARG42000
1415ER_SP_NO_RETSET0A000
1416ER_CANT_CREATE_GEOMETRY_OBJECT22003
1425ER_TOO_BIG_SCALE42000
1426ER_TOO_BIG_PRECISION42000
1427ER_M_BIGGER_THAN_D42000
1437ER_TOO_LONG_BODY42000
1439ER_TOO_BIG_DISPLAYWIDTH42000
1440ER_XAER_DUPIDXAE08
1441ER_DATETIME_FUNCTION_OVERFLOW22008
1451ER_ROW_IS_REFERENCED_223000
1452ER_NO_REFERENCED_ROW_223000
1453ER_SP_BAD_VAR_SHADOW42000
1458ER_SP_WRONG_NAME42000
1460ER_SP_NO_AGGREGATE42000
1461ER_MAX_PREPARED_STMT_COUNT_REACHED42000
1463ER_NON_GROUPING_FIELD_USED42000
1557ER_FOREIGN_DUPLICATE_KEY23000
1568ER_CANT_CHANGE_TX_ISOLATION25001
1582ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT42000
1583ER_WRONG_PARAMETERS_TO_NATIVE_FCT42000
1584ER_WRONG_PARAMETERS_TO_STORED_FCT42000
1586ER_DUP_ENTRY_WITH_KEY_NAME23000
1613ER_XA_RBTIMEOUTXA106
1614ER_XA_RBDEADLOCKXA102
1630ER_FUNC_INEXISTENT_NAME_COLLISION42000
1641ER_DUP_SIGNAL_SET42000
1642ER_SIGNAL_WARN01000
1643ER_SIGNAL_NOT_FOUND02000
1645ER_RESIGNAL_WITHOUT_ACTIVE_HANDLER0K000
1687ER_SPATIAL_MUST_HAVE_GEOM_COL42000
1690ER_DATA_OUT_OF_RANGE22003
1698ER_ACCESS_DENIED_NO_PASSWORD_ERROR28000
1701ER_TRUNCATE_ILLEGAL_FK42000
1758ER_DA_INVALID_CONDITION_NUMBER35000
1761ER_FOREIGN_DUPLICATE_KEY_WITH_CHILD_INFO23000
1762ER_FOREIGN_DUPLICATE_KEY_WITHOUT_CHILD_INFO23000
1792ER_CANT_EXECUTE_IN_READ_ONLY_TRANSACTION25006
1845年ER_ALTER_OPERATION_NOT_SUPPORTED0A000
1846年ER_ALTER_OPERATION_NOT_SUPPORTED_REASON0A000
1859年ER_DUP_UNKNOWN_IN_INDEX23000
1873年ER_ACCESS_DENIED_CHANGE_USER_ERROR28000
1887年ER_GET_STACKED_DA_WITHOUT_ACTIVE_HANDLER0Z002
1903年ER_INVALID_ARGUMENT_FOR_LOGARITHM2201E