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 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166
|
.TH odbcinst 1 "2nd Mar 2002" UnixODBC "UnixODBC Reference"
.SH NAME
odbcinst \- command line tool for batch ODBC configuration
.SH SYNOPSIS
.B odbcinst
.I action object options
.PP
.B action
is one of
.RS
.IP -i
install a driver or data source
.IP -u
uninstall a driver or data source
.IP -q
query a list of drivers or data sources present on the system
.IP --version
shows the version number of the program
.RE
.PP
.B object
is one of
.RS
.IP -d
an ODBC driver in
.I /etc/odbcinst.ini
.IP -s
an ODBC Data Source Name (DSN) in an
.I odbc.ini
file.
.RE
.PP
.B options
are zero or more of
.RS
.TP
.BI "-f " "template file"
Used with
.BR -i ,
this option specifies a template file containing the driver or DSN
to be installed.
.TP
.B -r
Read the template from standard input.
.TP
.BI "-n " "Driver/Data Source Name"
Used with
.B -u
to specify a driver or DSN to remove.
.TP
.B -v
Contrary to standard practice, this turns
.B off
verbose output; there is no output, even for errors.
.TP
.B -l
The specified Data Source object is a System DSN, in
.IR /etc/odbc.ini .
.TP
.B -h
The specified Data Source object is a User DSN, in the current user's
.IR $HOME/.odbc.ini .
This is the default with
.BR -s .
.RE
.SH DESCRIPTION
.B odbcinst
updates the configuration files that control ODBC access to database
servers on the current host. It also maintains in
.I /etc/odbcinst.ini
a count of the number of references to a particular driver, which can be
used to determine whether it should be removed from the file (only when
the reference count drops to 0).
.SS Installing
Drivers and DSNs are installed using the
.B -i
option.
.PP
If the object to be installed is a
.I driver
.RB ( -d ),
the specified driver is added to
.I /etc/odbcinst.ini
or its reference count is incremented if it is already there.
.PP
If the object is a
.I data source
.RB ( -s ),
the data source is added either to
.I /etc/odbc.ini
(if
.B -l
is used) or to
.I $HOME/.odbc.ini
(the default, which can also be specified with
.B -h\fP).
.SS Uninstalling
Uninstalling a driver is done with the command
.B odbcinst -u -d -n
.IR " driver name" .
Uninstalling a DSN is done with the command
.B odbcinst -u -s -n
.IR " data source name" .
Uninstalling causes the reference count on the object to be decremented.
If nothing else has requested this driver or DSN (i.e., the reference
count drops to zero), it is removed from the config file.
.PP
The options
.BR -l " and " -h
are used with
.B -s
to specify which
.I odbc.ini
file to configure.
.SS Queries
The command
.B odbcinst -q -d
returns a list of all drivers present in
.IR /etc/odbcinst.ini .
The command
.B odbcinst -q -s
returns a list of all system and user DSNs available.
.SH EXIT STATUS
.TP
.B 0
Success
.TP
.B non-zero
Failure
.SH TEMPLATE FILES
A typical driver template looks like this:
.RS
[MySQL]
Description = MySQL driver
Driver = /usr/lib/odbc/libmyodbc.so
Setup = /usr/lib/odbc/libodbcmyS.so
.RE
.PP
A DSN template looks like this:
.RS
[Sample DSN]
Description = Test MySQL connection
Driver = MySQL
Trace = Yes
TraceFile = /tmp/odbc.log
Database = junk
Server = localhost
Port = 3306
Socket =
.RE
.PP
The
.BR "Description " and " Driver"
fields should be present in all DSN configurations. Other options are
driver-specific; consult your ODBC driver's documentation for a list of
allowed options, or see
.B ODBCConfig(1)
for a graphical tool that can be used to interactively set up a DSN or
driver the first time.
.SH FILES
.IR /etc/odbcinst.ini ", " /etc/odbc.ini ", " $HOME/.odbc.ini
.SH AUTHOR
This manual page was written by Oliver Elphick <olly@lfix.co.uk> and
Steve Langasek <vorlon@debian.org> for the Debian package of unixODBC.
.SH SEE ALSO
.BR ODBCConfig(1) ", " gODBCConfig(1)
|