2017-02-03 65 views
1

不知道爲什麼......freetds的不是從任何配置文件確認版本

我在/etc/freetds/freetds.conf相同的conf文件,在/usr/share/freetds/freetds.conf和〜 /.freetds.conf

# $Id: freetds.conf,v 1.12 2007/12/25 06:02:36 jklowden Exp $ 
# 
# This file is installed by FreeTDS if no file by the same 
# name is found in the installation directory. 
# 
# For information about the layout of this file and its settings, 
# see the freetds.conf manpage "man freetds.conf". 

# Global settings are overridden by those in a database 
# server specific section 
[global] 
     # TDS protocol version 
    tds version = 7.4 

    # Whether to write a TDSDUMP file for diagnostic purposes 
    # (setting this to /tmp is insecure on a multi-user system) 
; dump file = /tmp/freetds.log 
; debug flags = 0xffff 

    # Command and connection timeouts 
; timeout = 10 
; connect timeout = 10 

    # If you get out-of-memory errors, it may mean that your client 
    # is trying to allocate a huge buffer for a TEXT field. 
    # Try setting 'text size' to a more reasonable limit 
    text size = 64512 

# A typical Sybase server 
[egServer50] 
    host = symachine.domain.com 
    port = 5000 
    tds version = 5.0 

# A typical Microsoft server 
[egServer70] 
    host = ntmachine.domain.com 
    port = 1433 
    tds version = 7.0 

[cdcods] 
    host = *my_host* 
    port = 1433 
    tds version = 7.4 

my_host轉變是我的實際MSSQL主機。我連接到MSSQL 2012,因此我認爲7.4是正確的。

我使用的命令是$tsql -S cdcods -U 'my_domain\my_user' -P 'my_pass'

這裏的日誌:

log.c:196:Starting log file for FreeTDS 0.91 
     on 2017-02-03 13:20:19 with debug flags 0x4fff. 
iconv.c:330:tds_iconv_open(0x15749f0, UTF-8) 
iconv.c:187:local name for ISO-8859-1 is ISO-8859-1 
iconv.c:187:local name for UTF-8 is UTF-8 
iconv.c:187:local name for UCS-2LE is UCS-2LE 
iconv.c:187:local name for UCS-2BE is UCS-2BE 
iconv.c:349:setting up conversions for client charset "UTF-8" 
iconv.c:351:preparing iconv for "UTF-8" <-> "UCS-2LE" conversion 
iconv.c:391:preparing iconv for "ISO-8859-1" <-> "ISO-8859-1" conversion 
iconv.c:394:tds_iconv_open: done 
net.c:207:Connecting to *my_host* port 1433 (TDS version 4.2) 
net.c:272:tds_open_socket: connect(2) returned "Operation now in progress" 
net.c:312:tds_open_socket() succeeded 
util.c:156:Changed query state from DEAD to IDLE 
login.c:572:NT login not support using TDS 4.x or 5.0 
util.c:156:Changed query state from IDLE to DEAD 
util.c:331:tdserror(0x15749c0, 0x15749f0, 20002, 0) 
util.c:361:tdserror: client library returned TDS_INT_CANCEL(2) 
util.c:384:tdserror: returning TDS_INT_CANCEL(2) 
mem.c:615:tds_free_all_results() 
+0

執行'tsql -C'應該指出它所在的'freetds.conf'文件的位置。做到這一點,然後擺脫所有其他'freetds.conf'文件,以避免混淆。如果'tsql'正在查看兩個'freetds.conf'文件中的一個,請嘗試刪除其中的所有無關內容,例如Sybase和Microsoft服務器的示例。 –

回答

2

您正在運行freetds的v0.91不支持TDS 7.4版。 IIRC最高支持7.2。嘗試使用7.2版本。

如果你想使用TDS版本7.3,你至少需要FreeTDS 0.95,如果你想要7.4,你需要FreeTDS 1.0。

我有一個公關來澄清這一點,但它沒有被推送到文檔。

祝你好運!

+1

我從來沒有一個程序配置make和make install之前沒有任何問題。做得很好的freetds團隊,做得很好。 – Scott

+0

這對我來說沒有任何影響7 –

+0

CentOS 7可以「安裝」FreeTDS 0.95並通過EPEL支持最高達TDS 7.3版本。這裏有一個連接到安裝有FreeTDS的工作Vagrant CentOS 7盒子的鏈接:https://github.com/wharton/python-vagrant-centos7如果你遇到問題,可以試一下你試過的東西和你的配置的細節我們將很樂意提供幫助! – FlipperPA

相關問題