Home > CentOS, Perl > CentOS: Instalar y configurar FreeTDS

CentOS: Instalar y configurar FreeTDS

Intro

From http://freetds.schemamania.org/

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.

How to

1. Install FreeTDS for SyBase Connection

Freetds (http://freetds.schemamania.org/index.html)

	
        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:

export SYBASE=/usr/local/freetds

(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

About these ads
Categories: CentOS, Perl

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: