CentOS: Instalar y configurar FreeTDS
FreeTDS is a set of libraries for Unix and Linux that allows your programs to natively talk to Microsoft SQL Server and Sybase databases.
Technically speaking, FreeTDS is an open source implementation of the TDS (Tabular Data Stream) protocol used by these databases for their own clients. It supports many different flavors of the protocol and three APIs to access it. Additionally FreeTDS works with other software such as Perl and PHP, providing access from those languages as well.
Well i will use this to connect my Perl Scripts to SQL Server Databases in CentOS.
Currently in 6.3 using yum, version installed is not working correct with Perl DBD Module. By this reason i need to do this task manually from scratch.
1. Install FreeTDS for SyBase Connection
cd /tmp wget ftp://ftp.astron.com/pub/freetds/stable/freetds-stable.tgz tar xfvz freetds-stable.tgz cd freetds-folder ./configure --prefix=/usr/local/freetds make make install ln -s /usr/local/freetds/etc/freetds.conf /etc/freetds.conf
2. Configure environment vars
Create /etc/profile.d/sybase.sh file with this code:
(if you dont wanna do exec /bin/bash or logout and login again, type in a terminal too)
3. Configure freetds and server list
Modify /etc/freetds.conf and add those lines at the end
[SQLSERVER] host = IPADRESS (***.***.***.***) instance =MY_INSTANCE (Only if you have an instance) tds version = 8.0
Each server that you want to connect using –server param must be included here
3. Test your installation
Follow this link (http://freetds.schemamania.org/userguide/confirminstall.htm)
you can execute under terminal as root
$ tsql -S emforester -U sa #only connect? Password: 1>
if 1> simbol appears, you are correctly connected. Ctr+C to exit