Quantcast
Channel: Active questions tagged ubuntu - Stack Overflow
Viewing all articles
Browse latest Browse all 6015

Connect to sql server from linux environment using putty private key, sqlalchemy and pyodbc

$
0
0

Hi I am trying to read a dataframe from sql server from a linux(ubuntu server).The file(gscm.ppk) has the admin keys in it

I have used the following format to connect to sql server:

import urllib.parseimport pandas as pdimport sqlalchemy as saparams = urllib.parse.quote_plus("DRIVER={SQL Server Native Client 11.0};""SERVER=dagger;""DATABASE=test;""UID=ubuntu;")engine = sa.create_engine("mssql+pyodbc:///?odbc_connect={}".format(params))df = pd.read_sql("SELECT * FROM ROBALS", engine)

I keep getting this error:

sqlalchemy.exc.DBAPIError: (pyodbc.Error) ('01000', "[01000] [unixODBC] [Driver Manager]Can't open lib 'SQL Server' : file not found (0) (SQLDriverConnect)")(Background on this error at: https://sqlalche.me/e/14/dbapi)

I have downloaded the driver that goes with Ubuntu 20.04


Viewing all articles
Browse latest Browse all 6015

Trending Articles