Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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!

share|improve this question
    
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/

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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