File: msqlConnect.3

package info (click to toggle)
msql 2.0.3-5
  • links: PTS
  • area: non-free
  • in suites: hamm, slink
  • size: 3,596 kB
  • ctags: 2,483
  • sloc: ansic: 34,769; sh: 1,309; yacc: 1,084; perl: 328; makefile: 267
file content (73 lines) | stat: -rw-r--r-- 2,558 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
.\" msqlConnect - Connect to a Mini SQL database engine
.\" Copyright (c) 1996  Martin Schulze <joey@office.individual.net>
.\" 
.\" This program is free software; you can redistribute it and/or modify
.\" it under the terms of the GNU General Public License as published by
.\" the Free Software Foundation; either version 2 of the License, or
.\" (at your option) any later version.
.\" 
.\" This program is distributed in the hope that it will be useful,
.\" but WITHOUT ANY WARRANTY; without even the implied warranty of
.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
.\" GNU General Public License for more details.
.\" 
.\" You should have received a copy of the GNU General Public License
.\" along with this program; if not, write to the Free Software
.\" Foundation, Inc.,59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
.\"
.\" This manual page is written especially for Debian GNU/Linux.
.\"
.TH msqlConnect 3 "4 Aug 1996" "Mini SQL" "mSQL Programmer's Manual"
.SH NAME
msqlConnect \- Connect to a Mini SQL database engine
.SH SYNOPSYS
.nf
.B #include <msql.h>
.sp
.BI "int msqlConnect(char *" host );
.fi
.SH DESCRIPTION
.B 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
.IR /var/run/msqld/control .
See
.BR libmsql (3)
for Details in specifying a hostname.

.SH "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
.I msqlErrmsg
contains an appropriate text message.  This variable is defined in
.IR <msql.h> .

By
calling
.B 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
.I MINERVA_DEBUG
to one or more of the folowing values, separated by a colon ``:''.
The values are the same as described in
.BR msqld (8)
with the modification that they are prefixed by ``msql_''.

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

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