客户端错误消息参考
客户端错误消息源自MySQL客户端库。这是一个示例错误消息,如mysql客户端所显示:
shell>mysql -h no-such-host ERROR 2005 (HY000): Unknown MySQL server host 'no-such-host' (0)
每个客户端错误消息都包含错误代码,SQLSTATE值和消息字符串,如第B.1节“错误消息源和组件”中所述。如第B.2节“错误信息接口”中所述,这些组件可用。对于客户端错误,SQLSTATE值始终为'HY000'
(一般错误),因此对于区分一个客户端错误和另一个客户端错误没有意义。
客户端库还可以将来自服务器端并由客户端从服务器接收到的任何错误托管给客户端程序。有关服务器端错误的列表,请参见第B.3.1节“服务器错误消息参考”。
除了以下列表中的错误之外,客户端库还可以生成错误消息,这些错误消息的错误代码范围为1到999。请参见第B.3.3节“全局错误消息参考”。
Error number:
2000
; Symbol:CR_UNKNOWN_ERROR
;Message: Unknown MySQL error
Error number:
2001
; Symbol:CR_SOCKET_CREATE_ERROR
;Message: Can't create UNIX socket(%d)
Error number:
2002
; Symbol:CR_CONNECTION_ERROR
;Message: Can't connect to local MySQL server through socket '%s'(%d)
Error number:
2003
; Symbol:CR_CONN_HOST_ERROR
;Message: Can't connect to MySQL server on '%s'(%d)
Error number:
2004
; Symbol:CR_IPSOCK_ERROR
;Message: Can't create TCP/IP socket(%d)
Error number:
2005
; Symbol:CR_UNKNOWN_HOST
;Message: Unknown MySQL server host '%s'(%d)
Error number:
2006
; Symbol:CR_SERVER_GONE_ERROR
;Message: MySQL server has gone away
Error number:
2007
; Symbol:CR_VERSION_ERROR
;Message: Protocol mismatch; server version =%d, client version =%d
Error number:
2008
; Symbol:CR_OUT_OF_MEMORY
;Message: MySQL client ran out of memory
Error number:
2009
; Symbol:CR_WRONG_HOST_INFO
;Message: Wrong host info
Error number:
2010
; Symbol:CR_LOCALHOST_CONNECTION
;Message: Localhost via UNIX socket
Error number:
2011
; Symbol:CR_TCP_CONNECTION
;Message:%s via TCP/IP
Error number:
2012
; Symbol:CR_SERVER_HANDSHAKE_ERR
;Message: Error in server handshake
Error number:
2013
; Symbol:CR_SERVER_LOST
;Message: Lost connection to MySQL server during query
Error number:
2014
; Symbol:CR_COMMANDS_OUT_OF_SYNC
;Message: Commands out of sync; you can't run this command now
Commands were executed in an improper order. This error occurs when a function is called that is not appropriate for the current state of the connection. For example, if
mysql_stmt_fetch()
is not called enough times to read an entire result set(that is, enough times to returnMYSQL_NO_DATA
), this error may occur for the following C API call.Error number:
2015
; Symbol:CR_NAMEDPIPE_CONNECTION
;Message: Named pipe:%s
Error number:
2016
; Symbol:CR_NAMEDPIPEWAIT_ERROR
;Message: Can't wait for named pipe to host:%s pipe:%s(%lu)
Error number:
2017
; Symbol:CR_NAMEDPIPEOPEN_ERROR
;Message: Can't open named pipe to host:%s pipe:%s(%lu)
Error number:
2018
; Symbol:CR_NAMEDPIPESETSTATE_ERROR
;Message: Can't set state of named pipe to host:%s pipe:%s(%lu)
Error number:
2019
; Symbol:CR_CANT_READ_CHARSET
;Message: Can't initialize character set %s(path:%s)
Error number:
2020
; Symbol:CR_NET_PACKET_TOO_LARGE
;Message: Got packet bigger than 'max_allowed_packet' bytes
Error number:
2021
; Symbol:CR_EMBEDDED_CONNECTION
;Message: Embedded server
Error number:
2022
; Symbol:CR_PROBE_SLAVE_STATUS
;Message: Error on SHOW SLAVE STATUS:
Error number:
2023
; Symbol:CR_PROBE_SLAVE_HOSTS
;Message: Error on SHOW SLAVE HOSTS:
Error number:
2024
; Symbol:CR_PROBE_SLAVE_CONNECT
;Message: Error connecting to slave:
Error number:
2025
; Symbol:CR_PROBE_MASTER_CONNECT
;Message: Error connecting to master:
Error number:
2026
; Symbol:CR_SSL_CONNECTION_ERROR
;Message: SSL connection error:%s
Error number:
2027
; Symbol:CR_MALFORMED_PACKET
;Message: Malformed packet
Error number:
2028
; Symbol:CR_WRONG_LICENSE
;Message: This client library is licensed only for use with MySQL servers having '%s' license
Error number:
2029
; Symbol:CR_NULL_POINTER
;Message: Invalid use of null pointer
Error number:
2030
; Symbol:CR_NO_PREPARE_STMT
;Message: Statement not prepared
Error number:
2031
; Symbol:CR_PARAMS_NOT_BOUND
;Message: No data supplied for parameters in prepared statement
Error number:
2032
; Symbol:CR_DATA_TRUNCATED
;Message: Data truncated
Error number:
2033
; Symbol:CR_NO_PARAMETERS_EXISTS
;Message: No parameters exist in the statement
Error number:
2034
; Symbol:CR_INVALID_PARAMETER_NO
;Message: Invalid parameter number
The column number for
mysql_stmt_fetch_column()
was invalid.The parameter number for
mysql_stmt_send_long_data()
was invalid.A key name was empty or the amount of connection attribute data for
mysql_options4()
exceeds the 64KB limit.Error number:
2035
; Symbol:CR_INVALID_BUFFER_USE
;Message: Can't send long data for non-string/non-binary data types(parameter:%d)
Error number:
2036
; Symbol:CR_UNSUPPORTED_PARAM_TYPE
;Message: Using unsupported buffer type:%d(parameter:%d)
Error number:
2037
; Symbol:CR_SHARED_MEMORY_CONNECTION
;Message: Shared memory:%s
Error number:
2038
; Symbol:CR_SHARED_MEMORY_CONNECT_REQUEST_ERROR
;Message: Can't open shared memory; client could not create request event(%lu)
Error number:
2039
; Symbol:CR_SHARED_MEMORY_CONNECT_ANSWER_ERROR
;Message: Can't open shared memory; no answer event received from server(%lu)
Error number:
2040
; Symbol:CR_SHARED_MEMORY_CONNECT_FILE_MAP_ERROR
;Message: Can't open shared memory; server could not allocate file mapping(%lu)
Error number:
2041
; Symbol:CR_SHARED_MEMORY_CONNECT_MAP_ERROR
;Message: Can't open shared memory; server could not get pointer to file mapping(%lu)
Error number:
2042
; Symbol:CR_SHARED_MEMORY_FILE_MAP_ERROR
;Message: Can't open shared memory; client could not allocate file mapping(%lu)
Error number:
2043
; Symbol:CR_SHARED_MEMORY_MAP_ERROR
;Message: Can't open shared memory; client could not get pointer to file mapping(%lu)
Error number:
2044
; Symbol:CR_SHARED_MEMORY_EVENT_ERROR
;Message: Can't open shared memory; client could not create %s event(%lu)
Error number:
2045
; Symbol:CR_SHARED_MEMORY_CONNECT_ABANDONED_ERROR
;Message: Can't open shared memory; no answer from server(%lu)
Error number:
2046
; Symbol:CR_SHARED_MEMORY_CONNECT_SET_ERROR
;Message: Can't open shared memory; cannot send request event to server(%lu)
Error number:
2047
; Symbol:CR_CONN_UNKNOW_PROTOCOL
;Message: Wrong or unknown protocol
Error number:
2048
; Symbol:CR_INVALID_CONN_HANDLE
;Message: Invalid connection handle
Error number:
2049
; Symbol:CR_UNUSED_1
;Message: Connection using old(pre-4.1.1)authentication protocol refused(client option 'secure_auth' enabled)
Error number:
2050
; Symbol:CR_FETCH_CANCELED
;Message: Row retrieval was canceled by mysql_stmt_close()call
Error number:
2051
; Symbol:CR_NO_DATA
;Message: Attempt to read column without prior row fetch
Error number:
2052
; Symbol:CR_NO_STMT_METADATA
;Message: Prepared statement contains no metadata
Error number:
2053
; Symbol:CR_NO_RESULT_SET
;Message: Attempt to read a row while there is no result set associated with the statement
Error number:
2054
; Symbol:CR_NOT_IMPLEMENTED
;Message: This feature is not implemented yet
Error number:
2055
; Symbol:CR_SERVER_LOST_EXTENDED
;Message: Lost connection to MySQL server at '%s', system error:%d
Error number:
2056
; Symbol:CR_STMT_CLOSED
;Message: Statement closed indirectly because of a preceding %s()call
Error number:
2057
; Symbol:CR_NEW_STMT_METADATA
;Message: The number of columns in the result set differs from the number of bound buffers. You must reset the statement, rebind the result set columns, and execute the statement again
Error number:
2058
; Symbol:CR_ALREADY_CONNECTED
;Message: This handle is already connected. Use a separate handle for each connection.
Error number:
2059
; Symbol:CR_AUTH_PLUGIN_CANNOT_LOAD
;Message: Authentication plugin '%s' cannot be loaded:%s
Error number:
2060
; Symbol:CR_DUPLICATE_CONNECTION_ATTR
;Message: There is an attribute with the same name already
A duplicate connection attribute name was specified for
mysql_options4()
.Error number:
2061
; Symbol:CR_AUTH_PLUGIN_ERR
;Message: Authentication plugin '%s' reported error:%s
Error number:
2062
; Symbol:CR_INSECURE_API_ERR
;Message: Insecure API function call:'%s' Use instead:'%s'
An insecure function call was detected. Modify the application to use the suggested alternative function instead.
Error number:
2063
; Symbol:CR_FILE_NAME_TOO_LONG
;Message: File name is too long
CR_FILE_NAME_TOO_LONG
was added in 8.0.1.Error number:
2064
; Symbol:CR_SSL_FIPS_MODE_ERR
;Message: Set FIPS mode ON/STRICT failed
CR_SSL_FIPS_MODE_ERR
was added in 8.0.11.Error number:
2065
; Symbol:CR_COMPRESSION_NOT_SUPPORTED
;Message: Compression protocol not supported with asynchronous protocol
CR_COMPRESSION_NOT_SUPPORTED
was added in 8.0.16, removed after 8.0.20.Error number:
2065
; Symbol:CR_DEPRECATED_COMPRESSION_NOT_SUPPORTED
;Message: Compression protocol not supported with asynchronous protocol
CR_DEPRECATED_COMPRESSION_NOT_SUPPORTED
was added in 8.0.21.Error number:
2066
; Symbol:CR_COMPRESSION_WRONGLY_CONFIGURED
;Message: Connection failed due to wrongly configured compression algorithm
CR_COMPRESSION_WRONGLY_CONFIGURED
was added in 8.0.18.Error number:
2067
; Symbol:CR_KERBEROS_USER_NOT_FOUND
;Message: SSO user not found, Please perform SSO authentication using kerberos.
CR_KERBEROS_USER_NOT_FOUND
was added in 8.0.20.Error number:
2068
; Symbol:CR_LOAD_DATA_LOCAL_INFILE_REJECTED
;Message: LOAD DATA LOCAL INFILE file request rejected due to restrictions on access.
CR_LOAD_DATA_LOCAL_INFILE_REJECTED
was added in 8.0.21.Error number:
2069
; Symbol:CR_LOAD_DATA_LOCAL_INFILE_REALPATH_FAIL
;Message: Determining the real path for '%s' failed with error(%d):%s
CR_LOAD_DATA_LOCAL_INFILE_REALPATH_FAIL
was added in 8.0.21.