How to solve the "ERROR [IM002] [unixODBC][Driver Manager]Data source name not found and no default driver specified" error when setting up an ODBC connection
Lately I was setting up a web application inside a Docker. container which communicates via ODBC with a database. In order to be able to query the database, I had to add the name of the database and the credentials into the odbc.ini and odbcinst.ini files. My queries were failing with the following message: “ERROR [IM002] [unixODBC][Driver Manager]Data source name not found and no default driver specified”
To fix the error, double-check the name of your DBs inside the “[…]” in your odbc.ini and odbcinst.ini files.
Chances are that you named the section differently than the Data Source Name (DSN) you defined in the ODBC Data Sources dialog: