

Problems w pyodbc and pymssql on Python 2.7 | Snakey Code
source link: https://snakeycode.wordpress.com/2021/02/12/problems-w-pyodbc-and-pymssql-on-python-2-7/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Problems w pyodbc and pymssql on Python 2.7
I am writing this in Feb 2021. Due to circumstances beyond my control, I am forced to use Python 2.7.
For many years I have been using pyodbc to connect to a remote SQL Server over an SSH tunnel. I have been using something like this: https://github.com/mkleehammer/pyodbc/wiki/Connecting-to-SQL-Server-from-Mac-OSX.
Last night my Mac auto-updated to 11.2. Suddenly I could no longer connect. I fiddled with stuff and was able to get tsql and isql working. But pyodbc would not run. Each time I ran it, I either got this error:
pyodbc.OperationalError: ('08001', u'[08001] [FreeTDS][SQL Server]Unable to connect to data source (0) (SQLDriverConnect)')
Or some sort of seg fault:
Process finished with exit code 134 (interrupted by signal 6: SIGABRT)
I got similar errors using pymssql.
Just for fun, I tried the same code in Python 3.8. Everything worked!
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK