Adding data sources for unixODBC/isql on Mac OSX Lion

3.3k views Asked by At

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

[ODBC]
Trace         = 0
TraceAutoStop = 0
TraceFile     = 
TraceLibrary  = 

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

[bar]
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                                  |
|                                       |
+---------------------------------------+
SQL> 

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!

1

There are 1 answers

0
Neil On

Found it, odbc.ini was in /usr/local/etc