【发布时间】:2017-08-23 14:24:42
【问题描述】:
早上好!
我在运行命令时遇到问题:
tsql -S "servername" - U "user" -P "password"
我得到命令的响应:
There was a problem connecting to the server
我正在尝试连接到 MS SQL 服务器。我已经检查了文档,但我还没有找到解决这个问题的方法。
我的 freetds.conf 是:
[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 日志文件我注意到以下错误:
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()
有人知道怎么解决吗?
谢谢!
【问题讨论】:
-
您的示例显示
- U(破折号和U之间的空格);尝试删除空间;还是在创建您的问题时这是一个错字?当您将服务器/用户/密码用引号括起来时,tsql是否正常工作?
标签: freetds