1、至ftp://ftp.unixodbc.org/pub/unixODBC/页面下载比较新的unixODBC-2.3.7.tar.gz
在你所选的目录下进行解压
tar -zxvf unixODBC-2.3.7.tar.gz
cd unixODBC-2.3.7
./configure --prefix=/usr/local/unixODBC-2.3.7 --includedir=/usr/include --libdir=/usr/lib --bindir=/usr/bin --sysconfdir=/etc
make
make install
2、安装unixODBC-dev
sudo apt-get install unixODBC-dev
3、安装freetds-dev、tdsodbc
sudo apt-get install freetds-dev tdsodbc
配置freetds
[
host = sql-server IP
port = 1433
tds version = 7.0
4、配置驱动程序odbcinst.ini
[FreeTDS]
Description = FreeTDS driver
Driver = /usr/lib/x86_64-linux-gnu/odbc/libtdsodbc.so
Setup = /usr/lib/x86_64-linux-gnu/odbc/libtdsS.so
FileUsage = 1
5、配置odbc.init数据库连接认证
[mssql]
Description = sqlserver connection
Driver = FreeTDS
TDS_Version = 4.2
Trace = On
TraceFile = stderr
Server = 127.0.0.1
Port = 1433
User = user
Password = password
Database = dbname
测试一下isql mssql user password