Here follows a huge copy-paste of my FreeTDS/iodbc/SQLServer notes:
FREETDS
Get yourself the latest build of FreeTDS (0.63 as of writing this),
and build it like so:
cd /usr/local/src
curl -O
ftp://ftp.ibiblio.org/pub/Linux/ALPHA/freetds/stable/freetds-stable.tgz
tar zxvf freetds-stable.tgz
cd freetds-0.63
./configure
At this point, we need to hack the generated libtool. Somewhere around
line 205 you should see:
archive_cmds="$CC $(if test .$module = .yes; then echo -bundle;
else echo -dynamiclib; fi) $allow_undefined_flag -o $lib $libobjs
$deplibs $linkopts -install_name $rpath/$soname $verstring"
Basically you need to remove the $deplibs in that line.
make
sudo make install
You can now test this by trying to connect to an MS SQL Server. To do
this, we’re using the tsql tool that is compiled along with FreeTDS:
$ tsql -H 10.9.0.95 -p 1147 -U sa
locale is “C”
locale charset is “US-ASCII”
Password:
1> use northwind
2> go
1> select count (*) as “Num” from customers
2> go
Num
91
1> exit
ODBC Administrator
ODBC Administrator
created by James A.
Firstly, add the driver under the “Drivers” tab.
Then you almost certainly want to create a User DSN, with the parameters
* Server e.g. localhost
* Database e.g. Northwind
* UID e.g. Administrator
* PWD
* Port e.g. 1147
This data gets stored in ~/Library/ODBC/odbc.ini. Any problems, you
can hack at that.
An entry should look like this:
[Redcats]
Driver = /opt/local/lib/libtdsodbc.so
Description = Redcats Development Database
Server = 10.9.0.95
Host = localhost\TESTSQL2
Port = 1147
Database = redcats_dev
UID =
PWD =
TDS_Version = 8.0
I’m not sure if you need to keep the ~/.freetds.conf in sync or not,
but i tend to. You need an entry to correspond with each ODBC entry:
[global]
tds version = 8.0
[Redcats]
host = GBLON1SQM27
port = 1147
… might be useful.