[unixODBC][Driver Manager]Data source name not found, and no default driver specified

Hello everyone,

I am trying to setup ODBC on Mongo Standalone Linux Server which is an EC2 Instance with OS ‘Amazon Linux 2’.

I have installed mongodb-bi-connector and my mongosqld service is running.

I have downloaded the required drivers which were in a compressed file (mongodb-connector-odbc-1.4.3-ubuntu-14.04-64.tar.gz) form here Releases · mongodb/mongo-bi-connector-odbc-driver · GitHub

Here’s my mongosqld.conf:
systemLog:
path: ‘/home/ec2-user/mongodb-bi-linux-x86_64-amzn64-v2.14.5/mongosqld.log’
net:
bindIp: ‘127.0.0.1’
port: 3307

Extracted files libmdbodbca.so & libmdbodbcw.so and placed it in /usr/local/lib directory as it is told in the documentaion

Created odbc.ini file and below is the config file

[MongoDBODBC]
DESCRIPTION = ODBC for MongoDB BI Connector
DRIVER = /usr/local/lib/libmdbodbcw.so
TRACE = Off
TRACEFILE = stderr
READONLY = yes
SERVER = myec2instace_public_ip (have also tried mongodb’s hostname)
PORT = 3307
USER =
PASSWORD =
DATABASE = stagingDB

Tested the odbc connection with unixODBC
executed the command iusql -v MongoDBODBC

And got the following error
[unixODBC][Driver Manager]Data source name not found, and no default driver specified
[ISQL]ERROR: Could not SQLDriverConnect

Can someone please tell me what am I missing here and what could the possible fixes to resolve this issue.

Thank you.

Seem like there is a syntax error or something.

The file is readable by the executing user? I just updated permission on /etc/odbc.ini and I get the same error when my user cannot read the file.

If you’re not aware you can also create a ~/.odbc.ini that is just for the user vs creating a system wide one.

1 Like

UPDATE
Instead of executing the command sudo iusql -v MongoDBODBC

I tried sudo isql -v MongoDBODBC
and then the connection was made
±--------------------------------------+
| Connected! |
| |
| sql-statement |
| help [tablename] |
| quit |
| |
±--------------------------------------+

Now the problem is I tested my odbc.ini and commented several lines from the configuration.
But the command sudo isql -v MongoDBODBC was still working.the SERVER and PORT variables were also commented in the configuration but still the connection was made. Now this is confusing.

However if I execute the command with iusql Igot the same error which I posted earlier.
I have updated the permissions of odbc.ini and have also tried creating the file ~/.odbc.ini but still the issue persists.

Pls help :frowning:

Out of advise on this one. I had to deliberately break it to get the error in the first place.