microsoft/homebrew-mssql-release

weird behavior on Mac M1 when using msodbcsql18

flixman opened this issue · 2 comments

I am trying to install msodbsql18, so that I can interact from a Mac M1 with a SQL database in azure:

brew tap microsoft/mssql-release https://github.com/Microsoft/homebrew-mssql-release
brew update
HOMEBREW_ACCEPT_EULA=Y brew install msodbcsql18 mssql-tools18

After this, I install pyodbc and I run the following script:

import pyodbc

server = 'server'
database = 'database'
username = 'username'
password = 'password'
driver = '{ODBC Driver 18 for SQL Server}'
conn = pyodbc.connect('DRIVER='+driver+';SERVER=tcp:'+server+';DATABASE='+database+';UID='+username+';PWD='+ password)

when running the connection line, this is what I get back:

>>> conn = pyodbc.connect('DRIVER='+driver+';SERVER=tcp:'+server+';DATABASE='+database+';UID='+username+';PWD='+ password)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
pyodbc.OperationalError: ('08001', '[08001] [Microsoft][ODBC Driver 18 for SQL Server]Client unable to establish connection because an error was encountered during handshakes before login. Common causes include client attempting to connect to an unsupported version of SQL Server, server too busy to accept new connections or a resource limitation (memory or maximum allowed connections) on the server. (26) (SQLDriverConnect)')

Should I run the same script from a linux box, it just works. I have seen some suggestions on the internet about installing the whole python setup, as well as msodbcsql18, using x86_64 emulation through rosetta... but I am getting again the same error.

Are you using same version of ODBC driver?

Closing as inactive.