msqlConnect(3)

NAME
msqlConnect - Connect to a Mini SQL database engine

SYNOPSYS
#include <msql.h>

int msqlConnect(char *host);

DESCRIPTION
msqlConnect() forms an interconnection with the mSQL database engine. It takes as its only argument the name or IP adress of the host running the mSQL server. If NULL is specified as the host argument, a connection is made to a server running on the localhost using the UNIX domain socket /var/run/msqld/control. See libmsql(3) for Details in specifying a hostname.

RETURN VALUE
On success a socket descriptor for the connection is returned. This value is used as a handle for all other calls to the mSQL API. If an error occurs, a value of -1 is returned and the variable msqlErrmsg contains an appropriate text message. This variable is defined in <msql.h>. By calling msqlConnect() more than once and asssigning the returned values to separate variables, connections to multiple database servers can be maintained simultaneously. If you wish to debug the API you may set MINERVA_DEBUG to one or more of the folowing values, separated by a colon ``:''. The values are the same as described in msqld(8) with the modification that they are prefixed by ``msql_''.

CAVEAT
In previous versions of mSQL, the MSQL_HOST environment variable could be used to specify a target machine if the host parameter was NULL. This is no longer the case.

SEE ALSO
msqlSelectDB(3), msqlQuery(3), msqlClose(3), msqld(8), msql(5).