MYSQL *mysql_real_connect(MYSQL *mysql, const char *host, const char *user, const char *passwd, const char *db, unsigned int port,
const char *unix_socket, unsigned long clientflag);
Les valeur des options clientflag sont :
Le résultat est non NULL en cas de succès.
#include <mysql.h>
static MYSQL *hConnexion;
...
hConnexion=mysql_init();
if (!hConnexion)
{
...
}
...
if (mysql_real_connect(hConnexion, "aix", "scott", "tiger", "mysql_aix", 0, NULL, (unsigned long)(CLIENT_MULTI_STATEMENTS|CLIENT_MULTI_RESULTS)))
{
...
}
...
mysql_close(hConnexion);
...