An unknown error occurred.
20.6.6.66.
mysql_sqlstate()
const char *mysql_sqlstate(MYSQL *mysql)
Description
Returns a null-terminated string containing the SQLSTATE error code for the most recently executed
SQL statement. The error code consists of five characters.
specified by ANSI SQL and ODBC. For a list of possible values, see
and Common
SQLSTATE values returned by
returned by mysql_errno(). For example, the
following format, where
mysql_sqlstate()
shell>
SELECT * FROM no_such_table;
ERROR 1146 (42S02): Table 'test.no_such_table' doesn't exist
Not all MySQL error numbers are mapped to SQLSTATE error codes. The value
error) is used for unmapped error numbers.
If you call
mysql_sqlstate()
return a useful value. For example, this happens if a host is blocked by the server and the connection is
closed without any SQLSTATE value being sent to the client.
Return Values
A null-terminated character string containing the SQLSTATE error code.
See Also
See
Section 20.6.6.14,
Section 20.6.10.26,
20.6.6.67.
mysql_ssl_set()
my_bool mysql_ssl_set(MYSQL *mysql, const char *key, const char *cert, const
char *ca, const char *capath, const char *cipher)
Description
mysql_ssl_set()
mysql_real_connect().
mysql_ssl_set()
is the connection handler returned from mysql_init(). The other parameters are specified as
mysql
follows:
•
is the path name to the key file.
key
•
is the path name to the certificate file.
cert
•
is the path name to the certificate authority file.
ca
•
is the path name to a directory that contains trusted SSL CA certificates in PEM format.
capath
•
is a list of permissible ciphers to use for SSL encryption.
cipher
Any unused SSL parameters may be given as NULL.
C API Function Descriptions
Problems.
mysql_sqlstate()
is the
1146
mysql_errno()
value:
after
"mysql_errno()",
"mysql_stmt_sqlstate()".
is used for establishing secure connections using SSL. It must be called before
does nothing unless SSL support is enabled in the client library.
'00000'
differ from MySQL-specific error numbers
client program displays errors using the
mysql
value and
mysql_real_connect()
Section 20.6.6.15,
2187
means "no error." The values are
Appendix C, Errors, Error Codes,
is the corresponding
'42S02'
'HY000'
fails,
mysql_sqlstate()
"mysql_error()", and
(general
might not