To establish an ODBC connection to KDC02, you will need to download and build FreeTDS.
You can do so through Homebrew (a package manager for Mac OS X).
Once Homebrew is installed, use the package manager to install a unixodbc driver. This can be done by typing the following in the command line:
$ brew install unixodbc
To install FreeTDS, enter:
$ brew install freetds --with-unixodbc
If you receive an error message with the first command, try:
$ brew install freetds
Now check to see where the FreeTDS is installed on your computer. The path to the folder that contains the FreeTDS files will be displayed during the brew install. Let’s assume this is your path:
When you are connected through Northwestern VPN, you can test the SQL login with:
$ /usr/local/Cellar/freetds/1.1.5/bin/tsql -S kdc02.kellogg.northwestern.edu -U 'kellogg\<YOUR_NETID>'
*Please enter your Net ID in place of <YOUR_NETID> and the appropriate path to the FreeTDS.
To setup unixodbc, you will need to find where the libtdsodbc.so file is stored. Let’s assume that it is here:
Then navigate to the folder that stores your freetds.config file by typing:
$ cd /usr/local/etc
To confirm that the freetds.config file is here, you can type ls in the command line to see the folder’s contents.
You can modify the odbcinst.ini and odbc.ini files that are installed with the FreeTDS within this directory. To modify the first file, enter:
$ vi odbcinst.ini
Once you are in the file with the vi editor, type I for insert. Then insert the following text in the file:
[FreeTDS] Description = FreeTDS Driver64 = /usr/local/Cellar/freetds/1.1.5/lib/libtdsodbc.so FileUsage = 1
To save the changes to the file type ESC and then :wq to save and exit the file. To exit without saving, hit ESC and type :q
You also need to modify odbc.ini with:
$ vi odbc.ini
When you are in the file with the vi editor, add the following text:
[kdc-tds] Driver = FreeTDS Server = kdc02.kellogg.northwestern.edu Port = 1433 UseNTLMv2 = Yes REALM = kellogg DumpFile = /usr/local/Cellar/freetds/1.1.5/freetds.log
*Please change the path of the log file if you would like it to save it somewhere easily accessible. This typically gets very large based on the size of your queries, so you might want to delete the contents periodically.
You can test the connection using isql:
$ isql kdc-tds 'kellogg\<YOUR_NETID>' "PASSWORD_HERE" –v