tar xvzf sqlcli-11.0.1790.0.tar.gz &&cd sqlcli-11.0.1790.0
./build_dm.sh #Script to download unixODBC-2.3.0, configure and compile it.#Get into the tempory folder where unixODBC-2.3.0 was compiled and execute make install#Before you install the driver, you may run a verify step to check if your computer has the required software to support the Microsoft SQL Server ODBC Driver 1.0 for Linux:./install.sh verify
#When you are ready to install the Microsoft SQL Server ODBC Driver 1.0 for Linux, run the install script:./install.sh install
To proceed installation of sqlncli with the latest version of UnixODBC, we have to modify these install scripts with :
1234567
cd sqlcli-11.0.1790.0
wget ftp://ftp.unixodbc.org/pub/unixODBC/unixODBC-2.3.1.tar.gz
find *.sh -exec sed -i ’s/2.3.0/2.3.1/g’ {}\;./build_dm.sh –download-url=file://unixODBC-2.3.1.tar.gz #Script to unzip unixODBC-2.3.1 (local), configure and compile it.
3 | Repair libraries paths
Now, normally you can find in /etc/odbcinst.ini
12345
[SQL Server Native Client 11.0]
Description=Microsoft SQL Server ODBC Driver V1.0 for Linux
Driver=/opt/microsoft/sqlncli/lib64/libsqlncli-11.0.so.1790.0
Threading=1
UsageCount=1
But if you tried isql or sqlcmd commands, you should have some surprises with this kind of problem :
1234
isql -v DN user password #DN located in you /etc/odbc.ini[01000][unixODBC][Driver Manager]Can‘t open lib ’/opt/microsoft/sqlncli/lib64/libsqlncli-11.0.so.1790.0’ : file not found
[ISQL]ERROR: Could not SQLConnect
To fix this issue, we have to find which libraries is missing for libsqlncli-11.0.so.1790.0