Pyodbc: Login Timeout Error

前端 未结 2 1763
广开言路
广开言路 2020-12-20 12:35

I am trying to connect to MS SQL Server using pyodbc from a remote machine running Ubuntu 16.04.

import pyodbc 

conn = pyodbc.connect(r\'DRIVER         


        
相关标签:
2条回答
  • 2020-12-20 13:25

    Microsoft's ODBC drivers for SQL Server do not use a PORT= parameter. The port number, if any, is appended to the server name/IP with a comma, e.g.,

    SERVER=xxxTest-SRV,51333;
    
    0 讨论(0)
  • 2020-12-20 13:25

    I ran into the same kind of issue, but my scenario is connecting to SQL server hosted on ec2 instance through AWS Lambda function using PyOdbc module. For me, replacing the host name with IP address of ec2 instance fixed it.

    I found out that it was not able to resolve dns. So if any of the above steps didn't work for you, please try using the ip address and comment here

    0 讨论(0)
提交回复
热议问题