Configure unixODBC for Ubuntu 14.04 using FreeTDS

unixODBC is a great utility for communicating with Microsoft SQL Server. FreeTDS ( http://www.freetds.org ) is a driver supported by unixODBC for communicating with MSSQL. In Ubuntu 14.04 both can be installed using the synaptics package manager, to successfully configure we will select the following packages for installation:

unixODBC Packages

Search for the term unixodbc in Synaptics

unixodbc
unixodbc-dev
unixodbc-bin
libodbc1
odbcinst1debian2
tdsodbc
php5-odbc
(Select all the dependencies asked to be installed along with them)

FreeTDS Packages

Search for the term freetds in Synaptics

freetds-bin
freetds-common
freetds-dev
libct4
libsybdb5

Once you have installed all these packages we need to checkout the version of FreeTDS driver that has installed on the Server.

Here two parameters are of primary concern to us for configuration
1. freetds.conf directory
2. TDS Version

As shown above freetds.conf directory is /etc/freetds and our TDS Version is 4.2

Now we need to edit /etc/odbcinst.ini but before that just find out the path of the libtdsodbc.so library
It is generally installed in /usr/lib/x86_64-linux-gnu/odbc/ directory but still you can verify by issuing the follwing command on the linux terminal

when i give isql -v test {username} {password} . i am getting the following error. ” isql: error while loading shared libraries: libodbc.so.2: cannot open shared object file: No such file or directory “. I have given permission with chmod 777 to libodbc.so.2, which is in /usr/local/bin..

libodbc.so.2 is a library file and ideally it should be in the library folder like ./usr/lib/x86_64-linux-gnu/libodbc.so.1
This is the place where system looks for the libraries. You can copy the file there and run ldconfig -v to update the library cache.

It seems you are having DNS error or error in the host name you are providing to FreeTDS
Please verify the host name and also verify that no firewall is blocking the port. You can use telnet to check the connectivity to the host machine and try specifying the IP instead of hostname