[rhelv6-list] FreeTDS
Mark Montague
markmont at umich.edu
Thu Aug 23 14:26:35 UTC 2012
On August 23, 2012 10:09 , "Tilsley, Jerry M." <jmtilsley at st-claire.org>
wrote:
> Has anyone successfully used FreeTDS with RHEL 6.x? I’m having trouble
> getting it to work. Works great on RHEL 5.7, but neither of my RHEL
> 6.x servers will work with it.
I'm successfully using FreeTDS on two RHEL 6.3 systems to connect to a
Microsoft SQL Server database via ODBC.
I followed the instructions for setting up PHP PDO, ODBC, and FreeTDS to
connect to MSSQL that are at
http://www.php.net/manual/en/ref.pdo-odbc.php#98716
Additional useful information is at http://lucasmanual.com/mywiki/unixODBC
I enabled the EPEL repository on my systems and then ran "yum install
freetds".
I created a tds.driver file containing:
[FreeTDS]
Description = FreeTDS v0.91
Driver64 = /usr/lib64/libtdsodbc.so.0
Setup64 = /usr/lib64/libtdsS.so
I created a tds.datasource file containing:
[MY-DATABASE-TAG]
Driver=FreeTDS
Description=My Database Description
Trace=No
Server=mydatabase-server-fqdn.example.com
Port=1433
TDS Version=7.1
Database=my_database_name
I then ran:
odbcinst -i -d -f tds.driver
odbcinst -i -s -l -f tds.datasource
At this point, I edited the files /etc/freetds.conf, /etc/odbcinst.ini,
/etc/odbc.ini and made sure everything was correct. IMPORTANT:
/etc/odbc.ini must have NO LEADING SPACES on any line, regardless of
what you may see in examples in documentation.
In /etc/freetds.conf, I have:
[my-server-tag]
host = mydatabase-server-fqdn.example.com
port = 1433
tds version = 7.1
In /etc/odbc.ini I have the same stanza as in tds.datasource
At this point, I was able to successfully test everything using both of
these commands:
osql -S MY-DATABASE-TAG -U 'my-ad-domain\my-username' -P
'password-goes-here' -I /etc
isql -v MY-DATABASE-TAF 'my-ad-domain\myusername 'password-goes-here'
I hope this helps.
--
Mark Montague
LSA Research Systems Group
University of Michigan
markmont at umich.edu
More information about the rhelv6-list
mailing list