Oracle 5.0 Reference Manual page 2198

Table of Contents

Advertisement

CR_IPSOCK_ERROR
Failed to create an IP socket.
CR_OUT_OF_MEMORY
Out of memory.
CR_SOCKET_CREATE_ERROR
Failed to create a Unix socket.
CR_UNKNOWN_HOST
Failed to find the IP address for the host name.
CR_VERSION_ERROR
A protocol mismatch resulted from attempting to connect to a server with a client library that uses a
different protocol version.
CR_NAMEDPIPEOPEN_ERROR
Failed to create a named pipe on Windows.
CR_NAMEDPIPEWAIT_ERROR
Failed to wait for a named pipe on Windows.
CR_NAMEDPIPESETSTATE_ERROR
Failed to get a pipe handler on Windows.
CR_SERVER_LOST
If
connect_timeout
connect to the server or if the server died while executing the init-command.
Example
MYSQL mysql;
mysql_init(&mysql);
mysql_options(&mysql,MYSQL_READ_DEFAULT_GROUP,"your_prog_name");
if (!mysql_real_connect(&mysql,"host","user","passwd","database",0,NULL,0))
{
fprintf(stderr, "Failed to connect to database: Error: %s\n",
mysql_error(&mysql));
}
By using
mysql_options()
sections in the
MySQL in some nonstandard way.
Note that upon connection,
structure) to a value of
MYSQL
A value of
1
connection, to try reconnecting to the server before giving up. As of MySQL 5.0.13, you can use the
MYSQL_OPT_RECONNECT
20.6.6.53.
mysql_real_escape_string()
unsigned long mysql_real_escape_string(MYSQL *mysql, char *to, const char
*from, unsigned long length)
C API Function Descriptions
[2942]
[2942]
[2941]
[2942]
[2942]
[2942]
[2942]
[2942]
[445]
> 0 and it took longer than
the MySQL library reads the
file which ensures that your program works, even if someone has set up
my.cnf
mysql_real_connect()
in versions of the API older than 5.0.3, or
1
for this flag indicates that if a statement cannot be performed because of a lost
option to
[2943]
connect_timeout
sets the
to control reconnection behavior.
mysql_options()
2178
[445]
and
[client]
[your_prog_name]
flag (part of the
reconnect
in newer versions.
0
seconds to

Advertisement

Table of Contents
loading

This manual is also suitable for:

Mysql 5.0

Table of Contents