Executing MSSQL-Queries on linux fedora 8.0

Hi there,

I have two machines.
One running linux and another running windows.
I am running my web site on linux with xampp server and i want to use the database thatis mssql-2005 installed on windows.I have no option of shifting to mysql bcz fromer company database is on mssql.
So please suggest me some solution....

I hav tried connecting with FreeTDS 0.61.2.

Initially, I install FreTDS on my Fedora machine as follows:
1) unzip file by issuing the following commands:

tar xvfz FreeTDS-0.61.2.tar.gz

2)From the /public folder, issue:

cd FreeTDS-0.61.2

3) This is what I used for the installation of FreeTDS:

./configure --prefix=/usr/local/freetds --sysconfdir=/usr/local/freetds --with-tdsver=7.0 --enable-msdblib --enable-threadsafe --enable-sybase-compat

4) Next, we compile the module tree, issue the following:


And install FreeTDS by issuing:

make install

5) change directory to this folder, and issue:

cd /usr/local/freetds

6) Edit freetds.conf:

gedit freetds.conf

7) I have a windows box running MS SQL Server 2005 on it. The machine name is LAB6-16 with IP address 192.168.x.xxx. Append the following part to FreeTDS.conf, and save it:

host = 192.168.x.xxx
port =1433
tds version = 7.0

Change to the bin folder under /usr/local/freetds, and issue:

tsql -S 'LAB6-16' -H '192.168.x.xxx' -p '1433' -U 'sa' –P '123456'

BUT instead of prompting 1> it returns ERROR as follows:

locale is "en_US.UTF-8"
charset is "UTF-8"
src/tds/login.c: tds_connect: 192.168.x.xxx:1433: Network is unreachable
Msg 20009, Level 9, State 0, Server OpenClient, Line 0
Server is unavailable or does not exist.
There was a problem connecting to the server

Can any body solve this problem or is there any other way to connect MSQL 2005 with Linux.

Please reply to amanjain17@gmail.com

Hi, About your problem with

Lo'Call's picture


About your problem with Freetds, amanjain17.
I can only give you a guess based on the "error messages" and crossed with my own experience.

1st.) There is no need to configure "/etc/freetds.conf" in order to use
I can say that since I was able to make up successfulls connections
on MSSQL 7.xx and nexts from fedora 8 and 10 with the conf file
resume at its strict minimum.
This is meaning in the [global] section there was only the
"text size = 64512" pair enabled and the ALL the rest ;REMed.
This first pair is NOTHING about your problem and only have use about
some case of "out-of-memory"
The others section [egServer50] and [egServer70] are examples for
typically a Sybase server and a Microsoft server and are ONLY provided
2nd) In My case... The machine hosting the MSSQL db is "ws-21-winxp".
My command line is:
- tsql -S ws-21-winxp -U admintest4 -P "password"
and the answer is :
locale is "en_US.UTF-8"
locale charset is "UTF-8"
1> use MyDBinsteadofTheMasterOne
2> go
The following queries work to perfection.
If I connect giving the IP I MUST to specify the port too.
- tsql -H -p 1433 -U admintest4 -P "password"
If the port is not specified it does NOT connect.
That's for the LINUX side.
In the Windows side:
I had to do a couple of things too.
a) open the 1433 port on the firewall
b) run the SQL Server Network Utility
"C:\Programs Files\Microsoft SQL Server\80\Tools\binn\SVRNETCN.exe"
and make sure that :
- TCP/IP is enabled as protocol,
- Server is visible (check box)
c) the name of workstation is foundable on the LAN.

This done, it HAVE to work !

My advice is, since You use a Fedora box, install Freetds from YUM or SMART.
In the yum case:
- yum -y install freetds
In the smart case:
- smart install freetds
If smart is not installed : yum -y install smart smart-gui fedora-package-config-smart (but I believe the last package is installed auto from dependencies. ...but it cost nothing to put it too on the command line)

I close with the most important, the interpretation of the error message.
it is not an authentication problem but HOW communication could or could not be done!

found the rpm in : for (F10)

and the doc in

Gone to send you this ingo by mail too.
Hope give some help.

White Paper
Linux Management with Red Hat Satellite: Measuring Business Impact and ROI

Linux has become a key foundation for supporting today's rapidly growing IT environments. Linux is being used to deploy business applications and databases, trading on its reputation as a low-cost operating environment. For many IT organizations, Linux is a mainstay for deploying Web servers and has evolved from handling basic file, print, and utility workloads to running mission-critical applications and databases, physically, virtually, and in the cloud. As Linux grows in importance in terms of value to the business, managing Linux environments to high standards of service quality — availability, security, and performance — becomes an essential requirement for business success.

Learn More

Sponsored by Red Hat

White Paper
Private PaaS for the Agile Enterprise

If you already use virtualized infrastructure, you are well on your way to leveraging the power of the cloud. Virtualization offers the promise of limitless resources, but how do you manage that scalability when your DevOps team doesn’t scale? In today’s hypercompetitive markets, fast results can make a difference between leading the pack vs. obsolescence. Organizations need more benefits from cloud computing than just raw resources. They need agility, flexibility, convenience, ROI, and control.

Stackato private Platform-as-a-Service technology from ActiveState extends your private cloud infrastructure by creating a private PaaS to provide on-demand availability, flexibility, control, and ultimately, faster time-to-market for your enterprise.

Learn More

Sponsored by ActiveState