FreeTDS User Guide: A Guide to Installing, Configuring and Running FreeTDS | ||
---|---|---|
Prev | Chapter 3. Install FreeTDS | Next |
You can use environment variables to
Advertise the location of the FreeTDS libraries to programs that want them.
Override some of the settings in FreeTDS's configuration file.
Control how logging is done.
The environment variable SYBASE points to the FreeTDS run-time directory. That convention originated with SYBASE, and many programs still rely on the 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).
The environment variable TDSVER 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.
The value specified in the TDSVER environment variable
A freetds.conf file entry (see below)
The interfaces file entry (see below)
The --with-tdsver option passed to configure
The FREETDSCONF environment variable may be used to specify the name and location of the freetds.conf file.
The TDSPORT environment variable specifies a TCP port number to be used to connect to the dataserver with. It overrides the version default port (1433 for TDS 4.2/7.0/8.0, 4000 for TDS 5.0) as well as any port specified in the freetds.conf file.
The TDSQUERY environment variable provides a server name to connect to if none is specified by the application. DSQUERY is the historical Sybase name for this variable.
The TDSHOST environment 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 Sybase and TDSVER do:
$ export SYBASE=/usr/local/freetds # (or your favorite directory) $ export TDSVER=4.2
In csh:
$ 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