gpt4 book ai didi

sql-server - 错误 20009(严重性 9):Unable to connect: Adaptive Server is unavailable or does not exist OS error 111, "Connection refused"

转载 作者:太空宇宙 更新时间:2023-11-03 16:47:52 28 4
gpt4 key购买 nike

尝试通过命令连接到 remort mssql 服务器时

tsql -S SQLEXPRESS  -U sa

密码:sa它抛出错误错误 20009(严重性 9):无法连接:Adaptive Server 不可用或不存在操作系统错误 111,“连接被拒绝”

我遵循的步骤 /etc/freetds/freetdsconf.conf

[SQLEXPRESS]
host = 192.168.1.9
port = 1433
tds version = 8.0
client charset = UTF-8

/etc/odbcinst.ini
[FreeTDS]
Description = TDS driver (Sybase/MS SQL)
Driver =/usr/lib/i386-linux-gnu/odbc/libtdsodbc.so
Setup =/usr/lib/i386-linux-gnu/odbc/libtdsS.so
CPTimeout =
CPReuse =
FileUsage = 1


etc/odbc.ini
[SQLEXPRESS]
Driver = FreeTDS
Description = ODBC connection via FreeTDS
Trace = No
Servername = 192.168.1.9
Database = cakephp_results
Port = 1433
UID = sa
PWD = sa
ReadOnly = No

最佳答案

在您的 odbc.ini 文件中,将“Servername =”更改为“Server =”。然后暂时从该文件中删除 UID、PWD 和 ReadOnly 行。您可能希望完全删除它们并从您的应用程序中传递凭据。

然后,确保您的 MSSQL DB 允许通过端口 1433 进行连接,SQL Server 没有阻止传入服务器的 IP 地址,并且您有正确的密码。

此外,如果这不起作用,请查看这些 troubleshooting说明:

关于sql-server - 错误 20009(严重性 9):Unable to connect: Adaptive Server is unavailable or does not exist OS error 111, "Connection refused",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17079433/

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