Freetds Connect to MS SQL Server 2019 all on Linux (Ubuntu 18.04)

If you want to connect to MS SQL Server 2019 all oon Linux (Ubuntu 18.04), Freetds is an option. We show you how to install Freetds and test wit query on Linux (Ubuntu 18.04) step by step.

MS SQL Server 2019 is on Linux

lsb_release -a
ps -ef|grep sqlservr

Get freetds 1.1.6-1 source package in Ubuntu

https://launchpad.net/ubuntu/+source/freetds/1.1.6-1

Install Freetds

tar -xvf .tar.gz cd freetds
./configure –help
./configure
make
sudo make install

driver on:

ll /usr/local/lib/libtdsodbc.so

configure: A typical Microsoft server

sudo vi /usr/local/etc/freetds.conf

[MSSQL2019]
host = 127.0.0.1
port = 1433
tds version = 7.3

test and query data

tsql -S MSSQL2019 -U sa -P [email protected]
use quote
go
select top 10 * from quote
go