gpt4 book ai didi

sql-server - 在 Ubuntu 上通过 TSQL 连接到 MSSQL 时遇到问题

转载 作者:太空宇宙 更新时间:2023-11-03 17:11:46 24 4
gpt4 key购买 nike

我正在使用 tsql 确认与 ms sql server 实例的连接:

tsql -S "66.239.210.201\[instance name],1481" -U [username]
Password: [password]

输出:

locale is "en_US.UTF-8"
locale charset is "UTF-8"
using default charset "UTF-8"
[counts from 1 to 16]
16There was a problem connecting to the server

记录freetds.log

> log.c:196:Starting log file for FreeTDS 0.91
> on 2016-02-11 14:01:46 with debug flags 0x4fff.
> iconv.c:330:tds_iconv_open(0x1eaea3b0, 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:934:tds7_get_instance_port(66.239.210.201, [redacted], 1481)
> net.c:985:tds7_get_instance_port: timed out on try 0 of 16
....
> net.c:985:tds7_get_instance_port: timed out on try 15 of 16
> net.c:1057:instance port is 0
> login.c:436:invalid port number
> mem.c:615:tds_free_all_results()

知道我做错了什么吗?我试过使用 -p 标志指定不同的端口,但总是得到相同的消息。我还尝试在 freetds.log 中放置一个条目:

[sqlserver]
host = 66.239.210.201
instance = MSSQLSERVER
tds version = auto

并将其与 tsql -S sqlserver 一起使用,这会产生与上述相同的错误文件。

感谢您的宝贵时间。

最佳答案

你的日志说

net.c:934:tds7_get_instance_port(66.239.210.201, [redacted], 1481) net.c:985:tds7_get_instance_port: timed out on try 0 of 16 .... net.c:985:tds7_get_instance_port: timed out on try 15 of 16 net.c:1057:instance port is 0

这意味着您的应用程序无法访问主机和端口对。可能有各种原因,例如防火墙。或 SQL 服务器端提到的访问规则。

作为第一步,您可以尝试远程登录到主机和端口对以检查它是否可访问

关于sql-server - 在 Ubuntu 上通过 TSQL 连接到 MSSQL 时遇到问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35346244/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com