Linux安装Freetds连接MSSQL

1.安装

Ubuntu:

sudo apt-get install git automake autoconf make gcc perl libtool pkg-config
git clone https://github.com/FreeTDS/freetds.git
./autogen.sh
make
sudo make install

Centos:

rpm -Uvh http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
gpg --quiet --with-fingerprint /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6
yum install freetds

2.修改配置文件

Ubuntu:

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

[ser2008]
      host = 192.168.11.252
      port = 1433
      tds version = 8.0
      client chaeset = UTF-8

Centos:

/etc/freetds.conf

[ser2008]
      host = 192.168.11.254
      port = 1433
      tds version = 8.0
      client chaeset = UTF-8

3.测试

/usr/local/bin/tsql -S ser2008 -U sa -P password

你可能感兴趣的:(Linux安装Freetds连接MSSQL)