Name

msqlConnect

Synopsis

int msqlConnect ( char *host ) 

Creates a connection to the mSQL server whose hostname or IP address is given. If a null value is passed as the argument, the connection is made to the mSQL server on the local host using Unix sockets. The return value is a database handle used to communicate with the database server. In the case of an error, -1 is returned.

Example

/* Create a connection to the database server on the local host */
dbh = msqlConnect( (char *)NULL );
if (dbh == -1) { 
   print "Error connecting!\n"; 
   exit(1); 
}

Get MySQL and mSQL now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.