Connecting to MSSQL

747 views
Skip to first unread message

carl....@gmail.com

unread,
Sep 12, 2014, 2:59:17 AM9/12/14
to pyo...@googlegroups.com
I'm on Mac OS X Mavericks, and trying to use pyodbc to connect to a Microsoft Azure MS SQL server.

Using tssql, I get this:

$ tsql -H xxxxxxxx.database.windows.net -p 1433 -U xxxxxx -P xxxxxx
 
locale is "en_AU.UTF-8"
locale charset is "UTF-8"using default charset "UTF-8"
Error 20002 (severity 9):
Adaptive Server connection failed
There was a problem connecting to the server


In python I'm trying the following:

import pyodbc
cnxn = pyodbc.connect('DRIVER={FreeTDS};SERVER=xxxxxx.database.windows.net;DATABASE=xxxxxx;UID=xxxxxx;PWD=xxxxxx')
cursor = cnxn.cursor()

and get:

Traceback (most recent call last):

  File "insights-stats-1.py", line 5, in <module>

    cnxn = pyodbc.connect('DRIVER={FreeTDS};SERVER=xxxxxx.database.windows.net;DATABASE=xxxxxx;UID=xxxxxx;PWD=xxxxxx')

pyodbc.Error: ('01000', "[01000] [unixODBC][Driver Manager]Can't open lib 'FreeTDS' : file not found (0) (SQLDriverConnect)")


I've tried {FreeTDS}, {SQL Server}, setting up a DNS and calling it through that instead of the server name, but none of it seems to be working for me.

Can anyone help me diagnose and step through this?

Thanks!

carl....@gmail.com

unread,
Sep 14, 2014, 6:48:45 AM9/14/14
to pyo...@googlegroups.com
Anyone? Even any ideas to try out would be helpful.

cpf...@gmail.com

unread,
Jan 25, 2015, 1:29:28 AM1/25/15
to pyo...@googlegroups.com
Anything yet? Looked through multiple sites but can't seem to find a way to connect to azure mssql from python hosted on linux

vanill...@gmail.com

unread,
Oct 2, 2017, 1:58:52 PM10/2/17
to pyodbc
I'm trying to find the solution to this as well...
Reply all
Reply to author
Forward
0 new messages