HOW TO Build non-root FreeTDS for Linux

This tutorial shows you how to build FreeTDS on any Linux (and probably Unix) system in a stand-alone fashion. No root or packages required.

Prerequisites:
You do need a compiler and functional build environment. If you can successfully ./configure && make && make install then you are all set.

Step 1: Get the software
Download the latest stable release from freetds.org

Step 2: Unpack
Unpack the software in to a directory different from the install directory.

In this example, I’m using /appserver/freetdsbuild/, but I will install in to /appserver/freetds-0.91/

mkdir /appserver/freetdsbuild/
cp freetds-stable.tgz /appserver/freetdsbuild/
cd /appserver/freetdsbuild/
gunzip freetds-stable.tgz
tar xf freetds-stable.tar
cd freetds-0.91

Step 3: Compile
Here we are going to configure it to install in to an alternate directory

./configure --prefix=/appserver/freetds-0.91 --exec-prefix=/appserver/freetds-0.91/ --enable-msdblib
make
make install

At this point it is safe to remove /appserver/freetdsbuild/ if you don’t need it.

Step 4: Make the symlink
The final stop is to make a symlink from /appserver/freetds-0.91 to /appserver/freetds. This lets you point your application to the freetds directory. If you need to modify to upgrade FreeTDS, you can build a new version and simply move the symlink. Your application won’t need to change.

ln -s /appserver/freetds-0.91/ /appserver/freetds/

Done!

P.S. You can find your config files in /appserver/freetds/etc/

Did you find this post useful or have questions or comments? Please let me know!

This entry was posted in How Tos, linux and tagged . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *