2016-07-13 43 views
3

freetds v0.91 - tds版本不匹配

我想在Ubuntu 14.04上使用FreeBSD連接到Windows SQL Server。 FreeTDS使用apt-get安裝。 我嘗試了不同的TDS版本,下面的命令:FreeTDS不使用配置的tds版本

$ TDSVER=7.0 tsql -H xxx.xxx.xxx.xxx -U xxxx -p 1433 -P xxxxxxx

日誌文件顯示:

... 
net.c:205:Connecting to xxx.xxx.xxx.xxx port 1433 (TDS version 7.0) 
net.c:270:tds_open_socket: connect(2) returned "Operation now in progress" 
net.c:310:tds_open_socket() succeeded 
... 

沒有問題就在這裏。但是,如果我改變TDSVER至7.4:

$ TDSVER=7.4 tsql -H xxx.xxx.xxx.xxx -U xxxx -p 1433 -P xxxxxxx

的TDS版本變得4.2?

... 
net.c:205:Connecting to xxx.xxx.xxx.xxx port 1433 (TDS version 4.2) 
net.c:270:tds_open_socket: connect(2) returned "Operation now in progress" 
net.c:310:tds_open_socket() succeeded 
... 

命令$ tsql -C的輸出是:

Compile-time settings (established with the "configure" script) 
          Version: freetds v0.91 
      freetds.conf directory: /etc/freetds 
    MS db-lib source compatibility: no 
     Sybase binary compatibility: yes 
         Thread safety: yes 
         iconv library: yes 
         TDS version: 4.2 
           iODBC: no 
          unixodbc: yes 
       SSPI "trusted" logins: no 
          Kerberos: yes 

我試圖配置TDS版本在〜/ .freetds.conf,結果是相同的。

freetds的v1.00.9 - 匹配

然後我試圖建立從混帳下載的版本,並在我的主文件夾安裝。似乎版本匹配:

$ TDSVER=7.4 .local/bin/tsql -H xxx.xxx.xxx.xxx -U xxxx -p 1433 -P xxxxxxx

... 
iconv.c:384:tds_iconv_open: done 
net.c:216:Connecting to xxx.xxx.xxx.xxx port 1433 (TDS version 7.4) 
net.c:242:tds_open_socket: connect(2) returned "Operation now in progress" 
net.c:343:tds_open_socket() succeeded 
... 

$ .local/bin/tsql -C輸出是:

Compile-time settings (established with the "configure" script) 
          Version: freetds v1.00.9 
      freetds.conf directory: /home/bgdata/.local/etc 
    MS db-lib source compatibility: no 
     Sybase binary compatibility: no 
         Thread safety: yes 
         iconv library: yes 
         TDS version: auto 
           iODBC: no 
          unixodbc: yes 
       SSPI "trusted" logins: no 
          Kerberos: no 
          OpenSSL: no 
          GnuTLS: no 
           MARS: no 

那是v0.91或我的錯誤做錯了什麼事? 謝謝。

回答

3

FreeTDS 0.91不支持TDS版本7.4。我有一個拉請求,希望讓這個文檔中更加清晰:

https://github.com/FreeTDS/freetds/pull/71/files

  • freetds的1.0+支持最多TDS版本7.4
  • freetds的0.95多達TDS版本支持7.3
  • freetds的0.91多達TDS版本支持7.2

此外,從來使用8.0,除非你使用的是舊版本的FreeTDS(你不應該在這一點上)非常。這也是文檔中涉及的一個長篇故事,但是網絡上有很多關於推薦的「指南」。它恢復到版本7.0,並可能產生問題。

相關問題