I have installed unixODBC from source and mysql-odbc connector from .dmg installer on Mac OSX Lion. This was done a while ago, and at that time I successfully installed a data source (let's call it foo). Now I am trying to add another data source (DSN). I've done this through both ODBC Manager and the command-line tool myodbc-installer given with the tar bundle of the mysql-odbc connector from the mysql website. An entry shows up in /Library/ODBC/odbc.ini, which looks like this:

[ODBC Data Sources]
bar = MySQL ODBC 5.1 Driver

Trace         = 0
TraceAutoStop = 0
TraceFile     = 
TraceLibrary  = 

Driver = /usr/local/lib/libmyodbc5.so
SERVER = localhost
PORT   = 3306

Driver      = /usr/local/lib/libmyodbc5.so
Description = 
DATABASE    = bar

However, isql fails to find it:

anitya:Preferences neil$ isql bar bar bar -v
[IM002][unixODBC][Driver Manager]Data source name not found, and no default driver specified
[ISQL]ERROR: Could not SQLConnect

Weird thing is, the old DSN foo, which is not to be seen in /Library/ODBC/odbc.ini or /etc/odbc.ini, works fine:

anitya:Preferences neil$ isql foo foo foo
| Connected!                            |
|                                       |
| sql-statement                         |
| help [tablename]                      |
| quit                                  |
|                                       |

I'm miffed about where the DSN entries need to be entered on OSX Lion to be found by isql. Thanks in advance for your help!

  • OS X ships with outdated, but updateable, iODBC driver manager, which uses the config files at /Library/ODBC/odbc*.ini and /Users/*/Library/ODBC/odbc*.ini. It's usually easier to build your ODBC-compliant tools with iODBC and use these files, than to force unixODBC into OS X. Symlinks can be made from whatever specific location an app developer decided was special, to the default files. – TallTed Sep 6 '15 at 3:26

Found it, the odbc file is in /usr/local/etc/

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.