UnixODBC on Mac OSX – Configuration Files – odbc.ini & odbcinst.ini

Configuration Files

To find the configuration files (odbc*.ini), issued:

sudo find / -name odbc*.ini 2>/dev/null

Upon issuance, received the file listing pasted below:

  • /Library/ODBC/odbc.ini
  • /Library/ODBC/odbcinst.ini
  • /usr/local/Cellar/unixodbc/2.3.1/etc/odbc.ini
  • /usr/local/Cellar/unixodbc/2.3.1/etc/odbcinst.ini
  • /usr/local/etc/odbc.ini
  • /usr/local/etc/odbcinst.ini

Did not have a clue which of these files is being used, so Googled for help:

/Library/ODBC/

Apple Mac OS/X

Link

When you use the iODBC ODBC Administrator tool, the odbcinst.ini and the odbc.ini files are typically located in the /Library/ODBC directory if the driver or datasource was installed system-visible. If the driver or datasource was installed to be user-visible, the odbcinst.ini and the odbc.ini files are in the $HOME/Library/ODBC directory.

At runtime, the iODBC Driver Manager searches for DSN information in $HOME/Library/ODBC/odbc.ini. If your DSN information is in /Library/ODBC/odbc.ini or in any other location, you need to set an environment variable called ODBCINI to the path to the odbc.ini file.

For example:

setenv ODBCINI full pathname to the odbc.ini file

 

It seems the /Library/ODBC files are used by iODBC.

Here is a sample odbc.ini file:

[ODBC Data Sources]
DBHR = jtds-1.3.0

[DBHR]
Driver = /Users/bsmith/Downloads/jtds-1.3.0-dist/jtds-1.3.0.jar
Description = DBHR

More about iODBC can be gleaned from here.

/usr/local/Cellar

Just started reading up a bit on Homebrew.  And, so this is still a bit in short-term memory.

It seems that folders underneath the /usr/local/Cellar/ folder are homebrew’s installs.

Furthermore /usr/local/Cellar/unixodbc/2.3.1 is unixodbc version 2.3.1

/usr/local/etc/

Changing Folder to /usr/local/etc and performing a quick ls revealed that the *.ini files in that folder are all symbolic links to aforementioned Cellar files.

That is, as long as Homebrew Installs are present and good we are OK.

References

  1. Apple Mac OS
    http://infocenter.sybase.com/help/index.jsp?topic=/com.sybase.infocenter.dc20116.1550/html/aseodbc/aseodbc54.htm 
  2. iODBC.Org
    http://www.iodbc.org/dataspace/iodbc/wiki/iODBC/FAQ

5 thoughts on “UnixODBC on Mac OSX – Configuration Files – odbc.ini & odbcinst.ini

    • Glad to have.

      I have only started using Mac, as well.

      There is a whole lot, I will like to contribute to the community.

      Just have not had the time.

      Happy Travel,
      Daniel

  1. Hi,
    I am using iODBC driver manager on unix to create an odbc installer.
    I use SQLGetInstalledDrivers to get list of all installed odbc drivers, it gives me error saying:

    ODBC Installer error 12: Invalid install path.
    [ERROR] Failed to query driver.

    When I set ODBCSYSINI and ODBCINI variable to current directory path, it ignores this path and still gives same error

    • Amey:

      I do not currently have my Mac computer and so I am unlikely to be able to help much.

      I take it that you ‘re a developer doing some development work.

      The error you ‘re encountering might be related to your Development Environment and its specific configuration.

      Have you tried testing you generic iODBC test using iodbctest?

      I think http://www.iodbc.org/dataspace/iodbc/wiki/iODBC/FAQ has one of the better documentations.

      I am sorry, but as I do not have my Mac, I can not really help.

      +Sorry,

      Daniel

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s