似乎没有任何关于设置此功能的详细说明。有人有什么好的指示吗?我是一个 Linux 菜鸟,所以要温柔。我确实看到了另一篇文章 类似,但没有真正的答案。
我有几个问题。
-
FreeTDS“似乎”不起作用。我正在尝试连接,并使用“tsql”命令收到以下消息:“默认数据库设置为databaseName
连接到服务器时出现问题”,但没有提及问题是什么。
尝试使用 pyodbc 连接时出现的错误是:“pyodbc.Error: ('08S01', '[08S01] [unixODBC][FreeTDS][SQL Server]无法连接: Adaptive Server is不可用或不存在 (20009) (SQLDriverConnectW)')"
我尝试使用 pymssql 进行类似的操作,但遇到了类似的问题。我不断收到无法连接的错误,但它没有告诉我原因。
There doesn't seem to be any great instructions for setting this up. Does anyone have any good instructions? I am a linux noob so be gentle. I did see another post that is similar, but no real answer.
I have a couple of problems.
-
FreeTDS doesn't "seem" to be working. I am trying to connect and I get the following message using the "tsql" command: "Default database being set to databaseName
There was a problem connecting to the server" but it doesn't mention what the problem is.
-
The error I get when I try to connect using pyodbc is: "pyodbc.Error: ('08S01', '[08S01] [unixODBC][FreeTDS][SQL Server]Unable to connect: Adaptive Server is unavailable or does not exist (20009) (SQLDriverConnectW)')"
-
I tried something similar with pymssql, but I ran into similar issues. I keep getting errors that I can't connect, but it doesn't tell me why.
发布评论
评论(3)
如果您将 MS SQL Server 配置为允许远程 TCP/IP 连接并拥有适当的用户进行连接,则以下操作有效。
您还需要小心地为 MS SQL 报告的数据库设置正确的主机名。
The following works if you configure the MS SQL server to allow remote TCP/IP connections and have an appropriate user to connect as.
You also need to be careful to set up the correct hostname for the db as reported by MS SQL.
构建 FreeTDS 时 (http://www.freetds.org/userguide/config.htm ):
When building FreeTDS (http://www.freetds.org/userguide/config.htm):
该错误表明 TDS 版本设置不正确。您可以在 FreeTDS 的配置设置中进行设置。您没有提及您正在使用哪个 MSSQL 版本。但是,如果您使用的是 2005 年,则将 TDS 版本设置为 8.0 即可。
That error suggests that the TDS version is not set right. You can set that in the configuration setting for FreeTDS. You don't mention which MSSQL version you are using. But, if you are using say 2005, setting 8.0 as the TDS version will work.