|FreeTDS User Guide: A Guide to Installing, Configuring, and Running FreeTDS|
|Prev||Chapter 3. Install FreeTDS||Next|
You can use environment variables to
Override some of the settings in FreeTDS's configuration file.
Advertise the location of the FreeTDS libraries to programs that want them.
Control how logging is done.
In a typical system, no environment variables need be used. They're sometimes handy for testing, for instance setting
TDSVER to check if a connection problem is due to using the wrong protocol version. And they have other uses, described below. But they're just knobs, so don't feel you have to turn every one, unless you're the sort that likes turning knobs.
may be used to specify the name and location of the freetds.conf file. In prior versions of FreeTDS this variable was known as
governs the version of the TDS protocol used to connect to your server. For a given server, FreeTDS inspects four sources in the following order to determine which TDS protocol version to use, using the first one it finds.
The value specified in
A freetds.conf file entry (see below)
The interfaces file entry (see below)
--with-tdsver option passed to configure
specifies a TCP port number at which the servername is listening. It overrides the default port (1433 for TDS 4.2/7.0/7.1/7.2/7.3/7.4, 4000 for TDS 5.0) as well as any port specified in the freetds.conf file.
points to the FreeTDS run-time directory. Use of this variable originated with Sybase (the company), and many programs still rely on
SYBASE to discover the location of the "SYBASE" libraries.
The primary use of
SYBASE is to advertise the location of the FreeTDS libraries. A secondary use is to point to the location of the interfaces file (if used, see the Appendix), which some programs examine directly.
provides a server name to connect to if none is specified by the application.
DSQUERY is the historical Sybase name for this variable.
overrides the host specified in the freetds.conf.
Of course, each shell is a little different. In the Bourne shell and variants such as ksh and bash, to set
$ export SYBASE=/usr/local/freetds # (or your favorite directory) $ export TDSVER=4.2
$ setenv SYBASE /usr/local/freetds $ setenv TDSVER 4.2
When you're done, you should see something very like this:
$ ls $SYBASE etc include interfaces lib