By Barry Stephens,2014-05-17 02:49
19 views 0

Login or Register Now Email: Password:









    MySQL Error Codes

    When using the MySQL extention mysqli or PDO, you may recieved an error message, or error code, back from

    your PHP code that looks cryptic or meaningless. This table is published to help those recieving these error to

    debug thier applications.

    MySQL errors are generated from two sources. The first is server errors and the second is client errors. The error

    messages are listed the source in the errmsg.txt file. This is a dynamic file and so, you should check there if the

    error message you are recieving is not listed here.

    1. Server Errors

    2. Client Errors

    Server Errors

    Error SQL StateMessageCode

    End of Server Errors

    Error: SQLSTATE: HY000 ER_HASHCHKMessage: hashchk1000

    Error: SQLSTATE: HY000 ER_NISAMCHKMessage: isamchk1001

    Error: SQLSTATE: HY000 ER_NOMessage: NO1002

    Error: SQLSTATE: HY000 ER_YESMessage: YES1003

    Error: Message: Can't create file SQLSTATE: HY000 ER_CANT_CREATE_FILE1004'%s' errno: %d

    Error: SQLSTATE: HY000 Message: Can't create table 1005ER_CANT_CREATE_TABLE'%s' errno: %d

    Error: Message: Can't create SQLSTATE: HY000 ER_CANT_CREATE_DB1006database '%s' errno: %dError: Message: Can't create SQLSTATE: HY000 ER_DB_CREATE_EXISTS1007database '%s'; database exists

    Message: Can't drop Error: SQLSTATE: HY000 ER_DB_DROP_EXISTSdatabase '%s'; database 1008doesn't exist

    Error: SQLSTATE: HY000 ER_DB_DROP_DELETEMessage: Error dropping

Error SQL StateMessageCode

    database can't delete '%s', 1009errno: %d

    Message: Error dropping Error: SQLSTATE: HY000 ER_DB_DROP_RMDIRdatabase can't rmdir '%s', 1010errno: %d

    Error: Message: Error on delete of SQLSTATE: HY000 ER_CANT_DELETE_FILE1011'%s' errno: %dError: SQLSTATE: HY000 Message: Can't read record 1012ER_CANT_FIND_SYSTEM_RECin system tableError: Message: Can't get status of SQLSTATE: HY000 ER_CANT_GET_STAT1013'%s' errno: %dError: Message: Can't get working SQLSTATE: HY000 ER_CANT_GET_WD1014directory errno: %dError: Message: Can't lock file SQLSTATE: HY000 ER_CANT_LOCK1015errno: %d

    Error: Message: Can't open file: SQLSTATE: HY000 ER_CANT_OPEN_FILE1016'%s' errno: %dError: Message: Can't find file: '%s' SQLSTATE: HY000 ER_FILE_NOT_FOUND1017errno: %d

    Error: Message: Can't read dir of SQLSTATE: HY000 ER_CANT_READ_DIR1018'%s' errno: %dError: Message: Can't change dir to SQLSTATE: HY000 ER_CANT_SET_WD1019'%s' errno: %d

    Message: Record has Error: SQLSTATE: HY000 ER_CHECKREADchanged since last read in 1020table '%s'

    Message: Disk full %s; Error: SQLSTATE: HY000 ER_DISK_FULLwaiting for someone to free 1021some space...Error: Message: Can't write; SQLSTATE: 23000 ER_DUP_KEY1022duplicate key in table '%s'Error: Message: Error on close of SQLSTATE: HY000 ER_ERROR_ON_CLOSE1023'%s' errno: %dError: Message: Error reading file SQLSTATE: HY000 ER_ERROR_ON_READ1024'%s' errno: %dError: Message: Error on rename of SQLSTATE: HY000 ER_ERROR_ON_RENAME1025'%s' to '%s' errno: %dError: Message: Error writing file SQLSTATE: HY000 ER_ERROR_ON_WRITE1026'%s' errno: %dError: Message: '%s' is locked SQLSTATE: HY000 ER_FILE_USED1027against changeError: SQLSTATE: HY000 ER_FILSORT_ABORTMessage: Sort aborted1028

    Error: SQLSTATE: HY000 ER_FORM_NOT_FOUNDMessage: View '%s' doesn't

Error SQL StateMessageCode

    1029exist for '%s'

    Error: Message: Got error %d from SQLSTATE: HY000 ER_GET_ERRNO1030storage engine

    Message: Table storage Error: SQLSTATE: HY000 ER_ILLEGAL_HAengine for '%s' doesn't have 1031this option

    Error: Message: Can't find record in SQLSTATE: HY000 ER_KEY_NOT_FOUND1032'%s'

    Error: Message: Incorrect SQLSTATE: HY000 ER_NOT_FORM_FILE1033information in file: '%s'Error: Message: Incorrect key file SQLSTATE: HY000 ER_NOT_KEYFILE1034for table '%s'; try to repair itError: Message: Old key file for SQLSTATE: HY000 ER_OLD_KEYFILE1035table '%s'; repair it!Error: SQLSTATE: HY000 Message: Table '%s' is read 1036ER_OPEN_AS_READONLYonly

    Message: Out of memory; Error: SQLSTATE: HY001 ER_OUTOFMEMORYrestart server and try again 1037needed %d bytes

    Message: Out of sort Error: SQLSTATE: HY001 memory; increase server sort 1038ER_OUT_OF_SORTMEMORYbuffer size

    Message: Unexpected EOF Error: SQLSTATE: HY000 ER_UNEXPECTED_EOFfound when reading file '%s' 1039errno: %d

    Error: Message: Too many SQLSTATE: 08004 ER_CON_COUNT_ERROR1040connections

    Message: Out of memory;

    check if mysqld or some

    other process uses all Error: available memory; if not, SQLSTATE: HY000 ER_OUT_OF_RESOURCES1041you may have to use 'ulimit'

    to allow mysqld to use more

    memory or you can add more

    swap space

    Error: Message: Can't get hostname SQLSTATE: 08S01 ER_BAD_HOST_ERROR1042for your address

    Error: SQLSTATE: 08S01 ER_HANDSHAKE_ERRORMessage: Bad handshake 1043

    Message: Access denied for Error: SQLSTATE: 42000 user '%s'@'%s' to database 1044ER_DBACCESS_DENIED_ERROR'%s'

    Message: Access denied for Error: SQLSTATE: 28000 user '%s'@'%s' using 1045ER_ACCESS_DENIED_ERRORpassword: %s

Error SQL StateMessageCode

    Error: Message: No database SQLSTATE: 3D000 ER_NO_DB_ERROR1046selected

    Error: SQLSTATE: 08S01 Message: Unknown 1047ER_UNKNOWN_COM_ERRORcommand

    Error: Message: Column '%s' SQLSTATE: 23000 ER_BAD_NULL_ERROR1048cannot be null Error: Message: Unknown database SQLSTATE: 42000 ER_BAD_DB_ERROR1049'%s'

    Error: SQLSTATE: 42S01 Message: Table '%s' already 1050ER_TABLE_EXISTS_ERRORexists

    Error: Message: Unknown table SQLSTATE: 42S02 ER_BAD_TABLE_ERROR1051'%s'

    Error: Message: Column '%s' in %s SQLSTATE: 23000 ER_NON_UNIQ_ERROR1052is ambiguous

    Error: Message: Server shutdown in SQLSTATE: 08S01 ER_SERVER_SHUTDOWN1053progress

    Error: Message: Unknown column SQLSTATE: 42S22 ER_BAD_FIELD_ERROR1054'%s' in '%s'

    Error: SQLSTATE: 42000 Message: '%s' isn't in 1055ER_WRONG_FIELD_WITH_GROUPGROUP BY

    Error: SQLSTATE: 42000 Message: Can't group on '%s' 1056ER_WRONG_GROUP_FIELD

    SQLSTATE: 42000 ER_WRONG_SUM_SELECTMessage: Statement has sum Error: functions and columns in 1057same statement Error: SQLSTATE: 21S01 Message: Column count 1058ER_WRONG_VALUE_COUNTdoesn't match value count Error: Message: Identifier name SQLSTATE: 42000 ER_TOO_LONG_IDENT1059'%s' is too long Error: Message: Duplicate column SQLSTATE: 42S21 ER_DUP_FIELDNAME1060name '%s'

    Error: Message: Duplicate key SQLSTATE: 42000 ER_DUP_KEYNAME1061name '%s'

    Error: Message: Duplicate entry SQLSTATE: 23000 ER_DUP_ENTRY1062'%s' for key %d Error: Message: Incorrect column SQLSTATE: 42000 ER_WRONG_FIELD_SPEC1063specifier for column '%s' Error: Message: %s near '%s' at line SQLSTATE: 42000 ER_PARSE_ERROR1064%d

    Error: SQLSTATE: HY000 ER_EMPTY_QUERYMessage: Query was empty 1065

    Error: Message: Not unique SQLSTATE: 42000 ER_NONUNIQ_TABLE1066table/alias: '%s' Error: SQLSTATE: 42000 ER_INVALID_DEFAULTMessage: Invalid default

Error SQL StateMessageCode

    1067value for '%s'

    Error: Message: Multiple primary SQLSTATE: 42000 ER_MULTIPLE_PRI_KEY1068key defined

    Message: Too many keys Error: SQLSTATE: 42000 ER_TOO_MANY_KEYSspecified; max %d keys 1069allowed

    Message: Too many key Error: SQLSTATE: 42000 parts specified; max %d parts 1070ER_TOO_MANY_KEY_PARTSallowed

    Message: Specified key was Error: SQLSTATE: 42000 ER_TOO_LONG_KEYtoo long; max key length is 1071%d bytes

    Error: SQLSTATE: 42000 Message: Key column '%s' 1072ER_KEY_COLUMN_DOES_NOT_EXITSdoesn't exist in table

    Message: BLOB column '%s' Error: can't be used in key SQLSTATE: 42000 ER_BLOB_USED_AS_KEY1073specification with the used

    table type

    Message: Column length too Error: SQLSTATE: 42000 big for column '%s' max = 1074ER_TOO_BIG_FIELDLENGTH%d; use BLOB instead

    Message: Incorrect table Error: definition; there can be only SQLSTATE: 42000 ER_WRONG_AUTO_KEY1075one auto column and it must

    be defined as a key

    Message: %s: ready for Error: SQLSTATE: HY000 ER_READYconnections. Version: '%s' 1076socket: '%s' port: %d Error: SQLSTATE: HY000 Message: %s: Normal 1077ER_NORMAL_SHUTDOWNshutdown

    Error: Message: %s: Got signal %d. SQLSTATE: HY000 ER_GOT_SIGNAL1078Aborting!

    Error: SQLSTATE: HY000 Message: %s: Shutdown 1079ER_SHUTDOWN_COMPLETEcomplete

    Error: Message: %s: Forcing close SQLSTATE: 08S01 ER_FORCING_CLOSE1080of thread %ld user: '%s' Error: Message: Can't create IP SQLSTATE: 08S01 ER_IPSOCK_ERROR1081socket

    Message: Table '%s' has no Error: index like the one used in SQLSTATE: 42S12 ER_NO_SUCH_INDEX1082CREATE INDEX; recreate

    the table

    Message: Field separator Error: SQLSTATE: 42000 argument is not what is 1083ER_WRONG_FIELD_TERMINATORSexpected; check the manual

Error SQL StateMessageCode

    Message: You can't use fixed Error: SQLSTATE: 42000 rowlength with BLOBs; 1084ER_BLOBS_AND_NO_TERMINATEDplease use 'fields terminated


    Message: The file '%s' must Error: SQLSTATE: HY000 be in the database directory 1085ER_TEXTFILE_NOT_READABLEor be readable by all Error: Message: File '%s' already SQLSTATE: HY000 ER_FILE_EXISTS_ERROR1086exists

    SQLSTATE: HY000 ER_LOAD_INFOMessage: Records: %ld Error: Deleted: %ld Skipped: %ld 1087Warnings: %ld

    Error: Message: Records: %ld SQLSTATE: HY000 ER_ALTER_INFO1088Duplicates: %ld

    Message: Incorrect sub part

    key; the used key part isn't a Error: string, the used length is SQLSTATE: HY000 ER_WRONG_SUB_KEY1089longer than the key part, or

    the storage engine doesn't

    support unique sub keys Error: SQLSTATE: 42000 Message: You can't delete all 1090ER_CANT_REMOVE_ALL_FIELDScolumns with ALTER



    Error: SQLSTATE: 42000 Message: Can't DROP '%s'; 1091ER_CANT_DROP_FIELD_OR_KEYcheck that column/key exists

    SQLSTATE: HY000 ER_INSERT_INFOMessage: Records: %ld Error: Duplicates: %ld Warnings: 1092%ld

    Message: You can't specify Error: SQLSTATE: HY000 target table '%s' for update in 1093ER_UPDATE_TABLE_USEDFROM clause

    Error: Message: Unknown thread SQLSTATE: HY000 ER_NO_SUCH_THREAD1094id: %lu

    Error: SQLSTATE: HY000 Message: You are not owner 1095ER_KILL_DENIED_ERRORof thread %lu

    Error: SQLSTATE: HY000 ER_NO_TABLES_USEDMessage: No tables used 1096

    Error: Message: Too many strings SQLSTATE: HY000 ER_TOO_BIG_SET1097for column %s and SET

    Message: Can't generate a Error: SQLSTATE: HY000 unique log-filename %s.1-1098ER_NO_UNIQUE_LOGFILE999

    Error: SQLSTATE: HY000 Message: Table '%s' was 1099ER_TABLE_NOT_LOCKED_FOR_WRITElocked with a READ lock

Error SQL StateMessageCode

    and can't be updated Error: SQLSTATE: HY000 Message: Table '%s' was not 1100ER_TABLE_NOT_LOCKEDlocked with LOCK TABLES

    Message: BLOB/TEXT Error: SQLSTATE: 42000 column '%s' can't have a 1101ER_BLOB_CANT_HAVE_DEFAULTdefault value

    Error: Message: Incorrect database SQLSTATE: 42000 ER_WRONG_DB_NAME1102name '%s'

    Error: SQLSTATE: 42000 Message: Incorrect table 1103ER_WRONG_TABLE_NAMEname '%s'

    Message: The SELECT

    would examine more than

    MAX_JOIN_SIZE rows;

    check your WHERE and use Error: SQLSTATE: 42000 ER_TOO_BIG_SELECTSET 1104SQL_BIG_SELECTS=1 or



    if the SELECT is okay Error: SQLSTATE: HY000 ER_UNKNOWN_ERRORMessage: Unknown error 1105

    Error: SQLSTATE: 42000 Message: Unknown 1106ER_UNKNOWN_PROCEDUREprocedure '%s'

    SQLSTATE: 42000 Message: Incorrect Error: ER_WRONG_PARAMCOUNT_TO_PROCEDUparameter count to procedure 1107RE'%s'

    SQLSTATE: HY000 Error: Message: Incorrect ER_WRONG_PARAMETERS_TO_PROCEDUR1108parameters to procedure '%s' E

    Error: Message: Unknown table SQLSTATE: 42S02 ER_UNKNOWN_TABLE1109'%s' in %s

    Error: SQLSTATE: 42000 Message: Column '%s' 1110ER_FIELD_SPECIFIED_TWICEspecified twice Error: SQLSTATE: HY000 Message: Invalid use of 1111ER_INVALID_GROUP_FUNC_USEgroup function

    Message: Table '%s' uses an Error: SQLSTATE: 42000 extension that doesn't exist in 1112ER_UNSUPPORTED_EXTENSIONthis MySQL version Error: SQLSTATE: 42000 Message: A table must have 1113ER_TABLE_MUST_HAVE_COLUMNSat least 1 column Error: Message: The table '%s' is SQLSTATE: HY000 ER_RECORD_FILE_FULL1114full

    Error: SQLSTATE: 42000 Message: Unknown 1115ER_UNKNOWN_CHARACTER_SETcharacter set: '%s'

Error SQL StateMessageCode

    Message: Too many tables; Error: SQLSTATE: HY000 ER_TOO_MANY_TABLESMySQL can only use %d 1116tables in a join

    Error: SQLSTATE: HY000 ER_TOO_MANY_FIELDSMessage: Too many columns 1117

    Error: Message: Row size too large. 1118The maximum row size for

    the used table type, not SQLSTATE: 42000 ER_TOO_BIG_ROWSIZEcounting BLOBs, is %ld.

    You have to change some

    columns to TEXT or BLOBs

    SQLSTATE: HY000 ER_STACK_OVERRUNMessage: Thread stack

    overrun: Used: %ld of a %ld Error: stack. Use 'mysqld -O 1119thread_stack=#' to specify a

    bigger stack if needed

    Message: Cross dependency Error: SQLSTATE: 42000 ER_WRONG_OUTER_JOINfound in OUTER JOIN; 1120examine your ON conditions

    Message: Column '%s' is Error: SQLSTATE: 42000 used with UNIQUE or 1121ER_NULL_COLUMN_IN_INDEXINDEX but is not defined as


    Error: Message: Can't load function SQLSTATE: HY000 ER_CANT_FIND_UDF1122'%s'

    Error: SQLSTATE: HY000 Message: Can't initialize 1123ER_CANT_INITIALIZE_UDFfunction '%s'; %s

    Error: Message: No paths allowed SQLSTATE: HY000 ER_UDF_NO_PATHS1124for shared library Error: Message: Function '%s' SQLSTATE: HY000 ER_UDF_EXISTS1125already exists

    Error: SQLSTATE: HY000 Message: Can't open shared 1126ER_CANT_OPEN_LIBRARYlibrary '%s' errno: %d %s Error: SQLSTATE: HY000 Message: Can't find function 1127ER_CANT_FIND_DL_ENTRY'%s' in library'

    Error: SQLSTATE: HY000 Message: Function '%s' is 1128ER_FUNCTION_NOT_DEFINEDnot defined

    SQLSTATE: HY000 ER_HOST_IS_BLOCKEDMessage: Host '%s' is

    blocked because of many Error: connection errors; unblock 1129with 'mysqladmin flush-


    Message: Host '%s' is not Error: SQLSTATE: HY000 allowed to connect to this 1130ER_HOST_NOT_PRIVILEGEDMySQL server

Error SQL StateMessageCode

    Message: You are using

    MySQL as an anonymous Error: SQLSTATE: 42000 user and anonymous users 1131ER_PASSWORD_ANONYMOUS_USERare not allowed to change


    Message: You must have

    privileges to update tables in Error: SQLSTATE: 42000 the mysql database to be able 1132ER_PASSWORD_NOT_ALLOWEDto change passwords for


    Message: Can't find any Error: SQLSTATE: 42000 matching row in the user 1133ER_PASSWORD_NO_MATCHtable

    Message: Rows matched: Error: SQLSTATE: HY000 ER_UPDATE_INFO%ld Changed: %ld 1134Warnings: %ld

    Error: SQLSTATE: HY000 Message: Can't create a new 1135ER_CANT_CREATE_THREADthread errno %d; if you are

    not out of available memory,

    you can consult the manual

    for a possible OS-dependent


    Message: Column count Error: SQLSTATE: 21S01 doesn't match value count at 1136ER_WRONG_VALUE_COUNT_ON_ROWrow %ld

    Error: SQLSTATE: HY000 Message: Can't reopen table: 1137ER_CANT_REOPEN_TABLE'%s'

    Error: SQLSTATE: 22004 Message: Invalid use of 1138ER_INVALID_USE_OF_NULLNULL value

    Error: Message: Got error '%s' from SQLSTATE: 42000 ER_REGEXP_ERROR1139regexp

    Error: SQLSTATE: 42000 Message: Mixing of GROUP 1140ER_MIX_OF_GROUP_FUNC_AND_FIELDScolumns

    MIN,MAX,COUNT,... with

    no GROUP columns is

    illegal if there is no GROUP

    BY clause

    Message: There is no such Error: SQLSTATE: 42000 grant defined for user '%s' on 1141ER_NONEXISTING_GRANThost '%s'

    Message: %s command Error: SQLSTATE: 42000 denied to user '%s'@'%s' for 1142ER_TABLEACCESS_DENIED_ERRORtable '%s'

    Error: SQLSTATE: 42000 Message: %s command 1143ER_COLUMNACCESS_DENIED_ERRORdenied to user '%s'@'%s' for

Error SQL StateMessageCode

    column '%s' in table '%s'

    Message: Illegal

    GRANT/REVOKE Error: SQLSTATE: 42000 command; please consult the 1144ER_ILLEGAL_GRANT_FOR_TABLEmanual to see which

    privileges can be used

    Message: The host or user Error: SQLSTATE: 42000 argument to GRANT is too 1145ER_GRANT_WRONG_HOST_OR_USERlong

    Error: Message: Table '%s.%s' SQLSTATE: 42S02 ER_NO_SUCH_TABLE1146doesn't exist

    Message: There is no such Error: SQLSTATE: 42000 grant defined for user '%s' on 1147ER_NONEXISTING_TABLE_GRANThost '%s' on table '%s'

    Message: The used command Error: SQLSTATE: 42000 is not allowed with this 1148ER_NOT_ALLOWED_COMMANDMySQL version

    Message: You have an error

    in your SQL syntax; check Error: the manual that corresponds SQLSTATE: 42000 ER_SYNTAX_ERROR1149to your MySQL server

    version for the right syntax

    to use

    Message: Delayed insert Error: SQLSTATE: HY000 thread couldn't get requested 1150ER_DELAYED_CANT_CHANGE_LOCKlock for table %s Error: SQLSTATE: HY000 Message: Too many delayed 1151ER_TOO_MANY_DELAYED_THREADSthreads in use

    Message: Aborted Error: SQLSTATE: 08S01 connection %ld to db: '%s' 1152ER_ABORTING_CONNECTIONuser: '%s' %s

    Message: Got a packet Error: SQLSTATE: 08S01 bigger than 1153ER_NET_PACKET_TOO_LARGE'max_allowed_packet' bytes Error: SQLSTATE: 08S01 Message: Got a read error 1154ER_NET_READ_ERROR_FROM_PIPEfrom the connection pipe Error: Message: Got an error from SQLSTATE: 08S01 ER_NET_FCNTL_ERROR1155fcntl

    Error: SQLSTATE: 08S01 Message: Got packets out of 1156ER_NET_PACKETS_OUT_OF_ORDERorder

    Message: Couldn't Error: SQLSTATE: 08S01 uncompress communication 1157ER_NET_UNCOMPRESS_ERRORpacket

    Error: SQLSTATE: 08S01 ER_NET_READ_ERRORMessage: Got an error 1158reading communication

Report this document

For any questions or suggestions please email