MySQL Error Codes- You may receive an error message while using MySQL extention mysqli or PDO, check out this table which will help you to debug your applications.There could be two type of error, the first might be server errors and the second is client errors. The error messages are listed the source in the errmsg.txt file.

Error Code SQL State Message

End of Server Errors Error: 1000 SQLSTATE: HY000 ER_HASHCHK Message: hashchk
Error: 1001 SQLSTATE: HY000 ER_NISAMCHK Message: isamchk
Error: 1002 SQLSTATE: HY000 ER_NO Message: NO
Error: 1003 SQLSTATE: HY000 ER_YES Message: YES
Error: 1004 SQLSTATE: HY000 ER_CANT_CREATE_FILE Message: Can’t create file ‘%s’ errno: %d
Error: 1005 SQLSTATE: HY000 ER_CANT_CREATE_TABLE Message: Can’t create table ‘%s’ errno: %d
Error: 1006 SQLSTATE: HY000 ER_CANT_CREATE_DB Message: Can’t create database ‘%s’ errno: %d
Error: 1007 SQLSTATE: HY000 ER_DB_CREATE_EXISTS Message: Can’t create database ‘%s’; database exists
Error: 1008 SQLSTATE: HY000 ER_DB_DROP_EXISTS Message: Can’t drop database ‘%s’; database doesn’t exist
Error: 1009 SQLSTATE: HY000 ER_DB_DROP_DELETE Message: Error dropping database can’t delete ‘%s’, errno: %d
Error: 1010 SQLSTATE: HY000 ER_DB_DROP_RMDIR Message: Error dropping database can’t rmdir ‘%s’, errno: %d
Error: 1011 SQLSTATE: HY000 ER_CANT_DELETE_FILE Message: Error on delete of ‘%s’ errno: %d
Error: 1012 SQLSTATE: HY000 ER_CANT_FIND_SYSTEM_REC Message: Can’t read record in system table
Error: 1013 SQLSTATE: HY000 ER_CANT_GET_STAT Message: Can’t get status of ‘%s’ errno: %d
Error: 1014 SQLSTATE: HY000 ER_CANT_GET_WD Message: Can’t get working directory errno: %d
Error: 1015 SQLSTATE: HY000 ER_CANT_LOCK Message: Can’t lock file errno: %d
Error: 1016 SQLSTATE: HY000 ER_CANT_OPEN_FILE Message: Can’t open file: ‘%s’ errno: %d
Error: 1017 SQLSTATE: HY000 ER_FILE_NOT_FOUND Message: Can’t find file: ‘%s’ errno: %d
Error: 1018 SQLSTATE: HY000 ER_CANT_READ_DIR Message: Can’t read dir of ‘%s’ errno: %d
Error: 1019 SQLSTATE: HY000 ER_CANT_SET_WD Message: Can’t change dir to ‘%s’ errno: %d
Error: 1020 SQLSTATE: HY000 ER_CHECKREAD Message: Record has changed since last read in table ‘%s’
Error: 1021 SQLSTATE: HY000 ER_DISK_FULL Message: Disk full %s; waiting for someone to free some space…
Error: 1022 SQLSTATE: 23000 ER_DUP_KEY Message: Can’t write; duplicate key in table ‘%s’
Error: 1023 SQLSTATE: HY000 ER_ERROR_ON_CLOSE Message: Error on close of ‘%s’ errno: %d
Error: 1024 SQLSTATE: HY000 ER_ERROR_ON_READ Message: Error reading file ‘%s’ errno: %d
Error: 1025 SQLSTATE: HY000 ER_ERROR_ON_RENAME Message: Error on rename of ‘%s’ to ‘%s’ errno: %d

To be continued in next post….