0
votes

I'm using ubuntu and trying to connect MSSQL server from python with pyodbc. I'm using pycharm professional. I'm trying to connect to sql server but I'm getting

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

Here is my code:

 def read_data(self):
    conn = pyodbc.connect('Trusted_Connection=yes', driver='FreeTDS', TDS_Version=7.3,    server='XXXXXXXXXX/SQL2014',
               port= 1433, database = 'YYYY')

I researched from the documents, I've already installed odbc and freetds.

1
Actually it didn't work. I'm trying to connect with pymssql now. I haven't met any problem with the connection when I'm using windows. But I'm using ubuntu for a short time and I couldn't connect since 5 hours. I tried many things, now I2m installing sql server to ubuntu. - Beyza
Have you checked the pyodbc wiki? - Gord Thompson
Yes but I didn't understand that where I'll create my text file. In pycharm or a tet file in anywhere? - Beyza
@Beyza - The text file is temporary. It can reside in any folder where you have read/write access, and it can be created with any text editor, even a console-based tool like vim or nano. (Also, remember to use "@..." on your reply comments so the person to whom you are replying gets notified.) - Gord Thompson

1 Answers

0
votes

My problem is solved. The source of my problem was my local db settings. Thanks for your comments.