1

I am having issues connecting to an Azure database from a Virtual Machine running Ubuntu 16.04. This VM is in Google cloud. I get the following error

pypyodbc.Error: (u'IM002', u'[IM002] [unixODBC][Driver Manager]Data source 
name                                                                                                                                             
not found, and no default driver specified')

This code works fine locally on my PC in a Jupyter notebook. I have added the Google Cloud VM's IP address to the let it through the Azure firewall- so that doesn't appear to be the cause of the error. I have observed that I can replicate the original error message in Jupyter notebook if I change the driver "SQL Server Native Client" from 11.0 to 13.0

This all points to driver issues. A similar issue has been discussed here With the problem being linked to "not defining that driver in the "/etc/odbcinst.ini" file."

My odbcinst.ini file contains the following information:

[ODBC Driver 13 for SQL Server]
Description=Microsoft ODBC Driver 13 for SQL Server
Driver=/opt/microsoft/msodbcsql/lib64/libmsodbcsql-13.1.so.8.0
UsageCount=1 

My odbc.ini file contains no information.

If I change my connection string in my code to "Driver={SQL Server Native Client 13.0" I get the same error. My other thought was to run with a version 11 of the driver. However there doesn't appear to be one for Ubuntu (only SUSE & RedHat Linux).I am new to this subject area- so feeling stuck. Any suggestions on a next logical step to resolve the connection issue.

Regards Mike

Mike
  • 67
  • 1
  • 6

0 Answers0