1

代码:

import pymssql
conn = pymssql.connect(host='BD', user='user', password='pass', database='Test')

它返回:

pymssql.InterfaceError: Connection to the database failed for an unknown reason

/etc/freetds/freetds.conf:

[BD]
        host = ip (not in local)
        port = 1219
        tds version = 7.0

我尝试:

tsql -S BD -U user

它返回:

1Error 20009 (severity 9):
    Unable to connect: Adaptive Server is unavailable or does not exist
    OS error 111

如何解决?这是否意味着我需要在带有 Windows 的 PC 上打开端口?怎么做?

谢谢。

4

0 回答 0