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
tar -xvf *.tar.gz
cd freetds*
./configure –help
./configure
make
sudo make install

# driver: /usr/local/lib/libtdsodbc.so
ll /usr/local/lib/libtdsodbc.so

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

# A typical Microsoft server
[MSSQL2019]
host = 127.0.0.1
port = 1433
tds version = 7.3

# test and query data
tsql -S MSSQL2019 -U sa -P 1qaz@WSX
use quote
go
select top 10 * from quote
go
————-
# Blog
https://digitfun.org/ms-sql-server/freetds-connect-to-ms-sql-server-2019-all-on-linux-ubuntu-18-04/
# Facebook
https://www.facebook.com/digitFun/

Comments are closed.