mkleehammer / pyodbc

Python ODBC bridge
https://github.com/mkleehammer/pyodbc/wiki
MIT No Attribution
2.92k stars 561 forks source link

Unable to connect to SQL Server from Mac OSX #1102

Closed GianlucaGuarroSonos closed 2 years ago

GianlucaGuarroSonos commented 2 years ago

Environment

Issue

I am trying to follow the guide for connection to SQL Server from Mac OSX

And when I test the connection with tsql -S MYMSSQL -U myuser -P mypassword (obviously using my actual credentials), it counts to 75 seconds and outputs the following error:

75Error 20009 (severity 9):
    Unable to connect: Adaptive Server is unavailable or does not exist
    OS error 60, "Operation timed out"

One thing I noticed that may be a cause for concern is that after I installed freetds, homebrew put my freetds.conf file in /opt/homebrew/etc. The guide says "Ensure the freetds.conf file is located in directory /usr/local/etc/" which is not the case for me.

Could someone tell me what it is that is going wrong?

v-chojas commented 2 years ago

Check what driver you're actually using in your DSN. The Microsoft ODBC Driver for SQL Server doesn't give such messages, so it looks like you're using the wrong driver.

gordthompson commented 2 years ago

"Unable to connect: Adaptive Server is unavailable or does not exist" is a FreeTDS error message, and tsql is a FreeTDS utility.