linux connect mssqlserver

let the linux programm connect to mssqlserver, install the third library - freetds.
here are the steps to make it work, don't ask why, just have a try.

 

1,setup unixODBC
./configure --prefix=/user/local/unixODBC
make
make install

 

2,setup freetds
./configure --prefix=/user/local/freetds --with-unixodbc=/user/local/unixODBC --with-tdsver=8.0 --enable-gui=no --enable-msdblib
make
make install

 

3,configure freetds
vi etc/freetds.conf
 [MyServer2k5]
 host = 192.168.90.5
 port = 1433
 tds version = 8.0
 client charset = GBK

 

./freetds/bin/tsql -S MyServer2k5 -H 192.168.90.5 -p 1433 -U sa -P 123456
./freetds/bin/tsql -S MyServer2k5 -U sa -P 123456 -D test

 

4,configure unixODBC
vi etc/odbcinst.ini
 [TDS]
 Description = MS-SQL Server
 Driver = /user/local/freetds/lib/libtdsodbc.so
 Setup = /user/local/freetds/lib/libtds.so
 FileUsage = 1

 

vi etc/odbc.ini
 [test];DSN
 Driver = TDS
 Servername = MyServer2k5
 Server = 192.168.90.5
 Database = test
 Port = 1433
 Socket =
 Option =
 Stmt =

 

vi /root/.odbc.ini
 [test]
 Driver = TDS
 Servername = MyServer2k5
 Server = 192.168.90.5
 Database = test
 Port = 1433
 
./unixODBC/bin/isql -v test sa 123456

 

 

code come last...

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值