Linux安装Freetds连接MSSQL

 

2018年03月28日 10:44:56 小五- 阅读数:247

 版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/wyw3547/article/details/79724110

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
  • 1
  • 2
  • 3
  • 4
  • 5

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
  • 1
  • 2
  • 3

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
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7

Centos:

/etc/freetds.conf

[ser2008]
      host = 192.168.11.254
      port = 1433
      tds version = 8.0
      client chaeset = UTF-8
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7

3.测试

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

你可能感兴趣的:(Python,SQL,LINUX,(ubuntu))