2012年5月2日星期三

MySQL Server error code 1000 - 1100

When an error occurs in MySQL, the server returns two types of error values:

  • A MySQL-specific error code. This value is numeric. It is not portable to other database systems.

  • An SQLSTATE value. The value is a five-character string (for example, 42S02. The values are taken from ANSI SQL and ODBC and are more standardized.


A message string that provides a textual description of the error is also available.
When an error occurs, the MySQL error code, SQLSTATE value, and message string are available using C API functions:

  • MySQL error code: Call mysql_errno()

  • SQLSTATE value: Call mysql_sqlstate()

  • Error message: Callmysql_error()



For prepared statements, the corresponding error functions are mysql_stmt_error(), mysql_stmt_sqlstate(), and mysql_stmt_error().
The number of errors, warnings, and notes for the previous statement can be obtained by calling mysql_warning_count().
The first two characters of an SQLSTATE value indicate the error class:

  • Class = 00 indicates success

  • Class = 01 indicates a warning

  • Class = 02 indicates "not found". This is relevant within the context of cursors and is used to control what happens when a cursor reaches the end of a data set. This condition also occurs for SELECT ... INTO var_list statements that retrieve no rows.

  • Class > 02 indicates an exception.



MySQL Server 错误消息信息列在share/errmsg.txt文件中。"%d" 和 "%s" 分别代表编号和字符串,显示时,它们将被消息值取代。
错误值列在 share/errmsg.txt 文件中,用于生成 include/mysqld_error.h 和 include/mysqld_ername.h MySQL源文件中的定义。
SQLSTATE 值列在share/errmsg.txt文件中,用于生成include/sql_state.h MySQL源文件中的定义。







































































































ErrorSQLSTATEMessage
1000HY000 (ER_HASHCHK)hashchk
1001HY000 (ER_NISAMCHK)isamchk
1002HY000 (ER_NO)N0
1003HY000 (ER_YES)YES
1004HY000 ((ER_CANT_CREATE_FILE)无法创建文件 '%s'(errno: %d)
1005HY000 (ER_CANT_CREATE_TABLE)无法创建表 '%s'(errno: %d)
1006HY000 (ER_CANT_CREATE_DB)无法创建库 '%s'(errno: %d)
1007HY000 (ER_DB_CREATE_EXISTS)无法创建数据库 '%s', 数据库已存在
1008HY000 (ER_DB_DROP_EXISTS)无法删除数据库 '%s',数据库不存在(can't drop '%s', errno: %d)。
1009HY000 (ER_DB_DROP_DELETE)删除数据库时出错(can't delete '%s', errno : %d)
1010HY000 (ER_DB_DROP_RMDIR)删除数据库时出错(can't rmdir '%s', errno : %d)
1011HY000 (ER_CANT_DELETE_FILE)删除 '%s' 时出错(errno: %d)
1012HY000 (ER_CANT_FIND_SYSTEM_REC)无法读取系统表中的记录。
1013HY000 (ER_CANT_GET_STAT)无法读取 '%s' 的状态(errno: %d)
1014HY000 (ER_CANT_GET_WD)无法获得工作目录(errno: %d)
1015HY000 (ER_CANT_LOCK)无法锁定文件 (errno: %d)
1016HY000 (ER_CANT_OPEN_FILE)无法打开文件:'%s' (errno: %d)
1017HY000 (ER_FILE_NOT_FOUND)无法找到文件 (errno: %d)
1018HY000 (ER_CANT_READ_DIR)无法读取 '%s' 的目录(errno: %d)
1019HY000 (ER_CANT_SET_WD)无法无 '%s' 更改目录 (errno: %d)
1020HY000 (ER_CHECKREAD)自上次读取原来表 '%s' 中的记录已更改
1021HY000 (ER_DISK_FULL)磁盘满 (%s);等待释放空间
1022HY000 (ER_DUP_KEY)无法写入;表 '%s' 重复键
1023HY000 (ER_ERROR_ON_CLOSE)关闭 '%s' 时出错 (errno: %d)
1024HY000 (ER_ERROR_ON_READ)读取文件 '%s' 时出错 (errno: %d)
1025HY000 (ER_ERROR_ON_RENAME)将 '%s' 重命为'%s'时出错 (errno: %d)
1026HY000 (ER_ERROR_ON_WRITE)写入文件 '%s' 时出错 (errno: %d)
1027HY000 (ER_FILE_USED)'%s' 已锁定,拒绝更改
1028HY000 (ER_FILSORT_ABORT)排序中断
1029HY000 (ER_FORM_NOT_FOUND)对于 '%s', 视图 '%s' 不存在
1030HY000 (ER_GET_ERRNO)从存储引擎中获得错误 %d
1031HY000 (ER_ILLEGAL_HA)表 '%s' 的存储引擎不含该选项
1032HY000 (ER_KEY_NOT_FOUND)无法在 '%s' 中找到记录
1033HY000 (ER_NOT_FORM_FILE)文件中有不正确信息:'%s'
1034HY000 (ER_NOT_KEYFILE)表 '%s', 键文件不存在,请尝试修复
1035HY000 (ER_OLD_KEYFILE)表 '%s' 旧的键文件,请修复
1036HY000 (ER_OPEN_AS_READONLY)表 '%s' 只能只读
1037HY000 (ER_OUTOFMEMORY)内存溢出,重启服务器并再次尝试(需要 %d 字节)
1038HY000 (ER_OUT_OF_SORTMEMORY)排序内存溢出,增加服务器的排序分类缓存大小。
1039HY000 (ER_UNEXPECTED_EOF)读取文件 '%s' 时出现意外 EOF (errno: %d)
1040HY000 (ER_CON_COUNT_ERROR)连接过多
1041HY000 (ER_OUT_OF_RESOURCES)内存溢出,请检查 mysqld 或其它进程是否使用了所有可用内存,如不然,或许应使用 'ulmit' 允许 mysqld 使用更多内存,或增加交换空间的大小
104208S01 (ER_BAD_HOT_ERROR)无法获得该地址给出的主机名
104308S01 (ER_HANDSHAKE_ERROR)握手失败
104442000 (ER_DBACCESS_DENIED_ERROR)拒绝用户 '%s'@'%s' 访问数据库 '%s'
104528000 (ER_ACCESS_DENIED_ERROR)拒绝用户 '%s'@'%s' 的访问(使用密码 '%s')
10463D000 (ER_NO_DB_ERROR)未选择数据库
104708S01 (ER_UNKNOWN_COM_ERROR)未知命令
104823000 (ER_BAD_NULL_ERROR)列 '%s' 不能为空
104942000 (ER_BAD_DB_ERROR)未知数据库 '%s'
105042S01 (ER_TABLE_EXISTS_ERROR)表 '%s' 已存在
105142S02 (ER_BAD_TABLE_ERROR)未知表:'%s'
105223000 (ER_NON_NUIQ_ERROR)'%s' 中的 '%s' 不唯一
105308S01 (ER_SERVER_SHUTDOWN)操作过程中服务器关闭
105442S22 (ER_BAD_FIELD_ERROR)'%s' 中的未知列 '%s'
105542000 (ER_WRONG_FIELD_WITH_GROUP)'%s' 不在 GROUP BY 中
105642000 (ER_WRONG_GROUP_FILED)无法在 '%s' 在创建组
105742000 (ER_WRONG_SUM_SELECT)语句中有 sum 函数和相同语句中的列
105821S01 (ER_WRONG_VALUE_COUNT)列计数不匹配值计数
105942000 (ER_TOO_LONG_IDENT)ID 名称 '%s' 过长
106042S21 (ER_DUP_FIELDNAME)重复列名 '%s'
106142000 (ER_DUP_KEYNAME)重复键名称 '%s'
106223000 (ER_DUP_ENTRY)键 '%s' 的重复记录 '%s'
106342000 (ER_WRONG_FIELD_SPEC)列 '%s' 属性定义不正确 (Incorrect column specifier for column '%s')
106442000 (ER_PARSE_ERROR)在行 %d 上, '%s' 靠近 '%s'
106542000 (ER_EMPTY_QUERY)查询为空
106642000 (ER_NONUNIQ_TABLE)表/别名 '%s' 不唯一
106742000 (ER_INVALID_DEFAULT)'%s' 无效默认值
106842000 (ER_MULTIPLE_PRI_KEY)定义了多个主键
106942000 (ER_TOO_MANY_KEYS)指定了过多键,允许的最大键数是 %d
107042000 (ER_TOO_MANY_KEYES_PARTS)指定了过多键部分:允许的最大键部分是 %d (Too many key parts specified; max %d parts allowed)
107142000 (ER_TOO_LONG_KEY)指定的键过长,最大键长度是 %d 字节
107242000 (ER_KEY_COLUMN_DOES_NOT_EXISTS)键列 '%s' 在表中不存在
107342000 (ER_BLOB_USED_AS_KEY)在表已使用的表存储类型中,BLOB 列 '%s' 不能用于 KEY 定义中 (BLOB column '%s' can't be used in key specification with the used table type)
107442000 (ER_TOO_BIG_FIELDLENGTH)列 '%s',列长度过大(max = %d),请使用 BLOB 或 TEXT 取代
107542000 (ER_WRONG_AUTO_KEY)不正确的表定义,只能有 1 个 auto 列,而且必须将其定义为键
1076HY000 (ER_READY)%s,连接就绪,版本: '%s', 套接字:'%s',端口:%d
1077HY000 (ER_NORMAL_SHUTDOWN)%s,正常关闭
1078HY000 (ER_GOT_SIGNAL)%s,获得信号 %d。放弃!
1079HY000 (ER_SHUTDOWN_COMPLETE)%s,关闭完成
108008S01 (ER_FORCING_CLOSE)%s,强制关闭线程 %ld,用户: '%s'
108108S01 (ER_IPSOCK_ERROR)无法创建 IP 套接字
108242S12 (ER_NO_SUCH_INDEX)表 '%s' 中没有与 CREATE INDEX 中索引类似的索引,重新创建表
108342000 (ER_WRONG_FIELD_TERMINATORS)字段分隔符参量不是预期的,请参考手册
108442000 (ER_BLOBS_AND_NO_TERMINATED)不能与 BLOB 一起使用固定行长度,请使用 'fields terminated by' (You can't use fixed rowlength with BLOBs; plese use 'fields terminated by')
1085HY000 (ER_TEXTFILE_NOT_READABLE)文件 '%s' 必须在数据库目录下,或能被所有人读取
1086HY000 (ER_FILE_EXISTS_ERROR)文件 '%s' 已存在
1087HY000 (ER_LOAD_INFO)记录, %ld;已删除,%ld;已跳过,%ld,警告,%ld
1088HY000 (ER_ALTER_INFO)记录,%ld;重复,%ld
1089HY000 (ER_WRONG_SUB_KEY)不正确的 KEY 前缀,使用的 KEY 不是字符串,所用的长度长于 KEY ;或存储引擎不支持前缀 KEY
109042000 (ER_CANT_REMOVE_ALL_FIELDS)不能用 ALTER TABLE 删除所有列,请使用 DROP TABLE 取而代之
109142000 (ER_CANT_DROP_FIELD_OR_KEY)不能删除 '%s',请检查列/KEY 是否存在
1092HY000 (ER_INSERT_INFO)记录, %ld;复制,%ld;警告,%ld
1093HY000 (ER_UPDATE_TABLE_USED)不能在 FROM 子句中指定要更新的目标表 '%s'
1094HY000 (ER_NO_SUCH_THREAD)未知线程 ID:%lu
1095HY000 (ER_KILL_DENIED_ERROR)不是线程 %lu 的所有者
1096HY000 (ER_NO_TABLES_USED)未使用任何表
1097HY000 (ER_TOO_BIT_SET)列 %s 和 SET 的字符串过多
1098HY000 (ER_NO_UNIQUE_LOGFILE)不能生成唯一的日志文件名 %s(1-999)
1099HY000 (ER_TABLE_NOT_LOCKED_FOR_WRITE)表 '%s' 已用 READ 锁定,不能更新
1100HY000 (ER_TABLE_NOT_LOCKED)未使用 LOCK TABLE 锁定表 '%s'

没有评论 :

发表评论