Search code examples
macosodbcdrivercommand-line-interfacefilemaker

Create an ODBC Connection via the Command Line on a Mac


I'm working on a Mac with a FileMaker ODBC Driver

I've successfully created new ODBC connections via this method: - open ODBC Manager - switch to system DSN tab - click add - select FileMaker ODBC driver - enter details (nickname, host, database)

How can I accomplish the same workflow via the command line on my mac?

My ideal pseudocode looks something like this: install_new_odbc_connection(nickname, host, database)

I've found a similar discussion for windows: Install An ODBC connection from cmd line

And here's a page which suggests that I might be able to edit some ini files directly, but I'm not sure how to do this: http://hiltmon.com/blog/2013/09/18/setup-odbc-for-r-on-os-x/


Solution

  • This depends on your ODBC Management software. If you use "ODBC Manager" from http://www.odbcmanager.net/index.php you can modify the file directly through the bash:

    /Library/ODBC/odbc.ini

    Based on this article:

    https://web.archive.org/web/20131007145001/https://www.jonathanstark.com/blog/setting-up-odbc-for-mysql-on-a-mac