首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >FreeTDS:不连接

FreeTDS:不连接
EN

Stack Overflow用户
提问于 2017-08-23 22:24:43
回答 1查看 169关注 0票数 1

早上!

我在运行命令时遇到问题:

代码语言:javascript
复制
tsql -S "servername" - U "user" -P "password"

我从命令中得到了as响应:

代码语言:javascript
复制
There was a problem connecting to the server

我正在尝试连接到MS SQL服务器。我已经检查了文档,但我还没有找到解决这个问题的方法。

我的freetds.conf是:

代码语言:javascript
复制
[global]
    # TDS protocol version
    tds version = 4.2

    # 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

[SRVBD1] 
        host = 10.7.1.7          
        instance = SQL2008
        port = 1434
        tds version = 5.0

检查FreeTDS日志文件时,我注意到以下错误:

代码语言:javascript
复制
11:21:27.243084 22487 (util.c:141):logic error: cannot change query state from READING to WRITING
11:21:27.243095 22487 (util.c:322):tdserror(0x6408e0, 0x13863b0, 20019, 0)
11:21:27.243103 22487 (util.c:358):tdserror: client library not called because either tds_ctx (0x6408e0) or tds_ctx->err_handler is NULL
11:21:27.243111 22487 (util.c:375):tdserror: returning TDS_INT_CANCEL(2)
11:21:27.243118 22487 (util.c:165):Changed query state from READING to READING
11:21:27.243132 22487 (util.c:165):Changed query state from READING to DEAD
11:21:27.243140 22487 (util.c:322):tdserror(0x6408e0, 0x13863b0, 20017, 0)
11:21:27.243148 22487 (util.c:358):tdserror: client library not called because either tds_ctx (0x6408e0) or tds_ctx->err_handler is NULL
11:21:27.243156 22487 (util.c:375):tdserror: returning TDS_INT_CANCEL(2)
11:21:27.243166 22487 (token.c:565):processing result tokens.  marker is  0()
11:21:27.243176 22487 (token.c:116):tds_process_default_tokens() marker is 0()
11:21:27.243184 22487 (token.c:119):leaving tds_process_default_tokens() connection dead
11:21:27.243191 22487 (util.c:83):logic error: cannot change query state from DEAD to PENDING
11:21:27.243199 22487 (util.c:165):Changed query state from DEAD to DEAD
11:21:27.243207 22487 (util.c:322):tdserror(0x6408e0, 0x13863b0, 20056, 9)
11:21:27.243214 22487 (util.c:358):tdserror: client library not called because either tds_ctx (0x6408e0) or tds_ctx->err_handler is NULL
11:21:27.243222 22487 (util.c:375):tdserror: returning TDS_INT_CANCEL(2)
11:21:27.243229 22487 (util.c:322):tdserror(0x6408e0, 0x13863b0, 20017, 0)
11:21:27.243238 22487 (util.c:358):tdserror: client library not called because either tds_ctx (0x6408e0) or tds_ctx->err_handler is NULL
11:21:27.243253 22487 (util.c:375):tdserror: returning TDS_INT_CANCEL(2)
11:21:27.243262 22487 (token.c:336):looking for login token, got  0()
11:21:27.243269 22487 (token.c:116):tds_process_default_tokens() marker is 0()
11:21:27.243277 22487 (token.c:119):leaving tds_process_default_tokens() connection dead
11:21:27.243285 22487 (login.c:472):login packet accepted
11:21:27.243292 22487 (util.c:322):tdserror(0x6408e0, 0x13863b0, 20002, 0)
11:21:27.243300 22487 (util.c:358):tdserror: client library not called because either tds_ctx (0x6408e0) or tds_ctx->err_handler is NULL
11:21:27.243307 22487 (util.c:375):tdserror: returning TDS_INT_CANCEL(2)
11:21:27.243315 22487 (mem.c:648):tds_free_all_results()

有人知道怎么解决这个问题吗?

谢谢!

EN

回答 1

Stack Overflow用户

发布于 2017-08-26 02:25:09

如果您的配置是使用tds version = 5.0,则SQL Server2008不支持它。你可以试试tds version = 7.1吗?另外,您确定它在端口1434上而不是1433 (默认端口)上吗?

如果这不起作用,我会在解决问题的过程中修改这个答案,但这是我看到的第一个答案。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/45842443

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档