Link to home
Start Free TrialLog in
Avatar of Lia Nungaray
Lia NungarayFlag for United States of America

asked on

Installing an ODBC connection in Fedora Core 5

I'm having a hard time installing freeTDS in Fedora Core 5. Many of the instructions that I've found on the Intranet require ODBCConfig, and I don't think that Fedora has this application. I am able to make a connection between freeTDS to my MSSQL server using tsql, I get stuck setting up the ODBC Data Source. Ideas anyone? Thanks!
Avatar of slyong
slyong

Why don't you use the FreeTDS rpm from Dries RPM? http://dries.studentenweb.org/rpm/packages/freetds/info.html

It solves you the dependencies problem.  Yum configuration instruction for Dries is here http://dries.studentenweb.org/rpm/clientconfig.html
Avatar of F. Dominicus
You need a bit more then ODBCConfig. you need all the libraries for CLI / ODBC programs on unix the following implementation do exist
iodbc: http://www.iodbc.org/
unixodbc: http://www.unixodbc.org/

ODBCconfig is part of unixodbc IIRC. So you can download the sources, compile them and then you set up you ODBC sources, how that is done is explained in the docs.

Regards
Friedrich
Avatar of Lia Nungaray

ASKER

Do I need a C++ compiler to do so?
OK, fridom and slyong, I just opened the pages you suggested and frankly, I am going to need a bit more of help! I'm a complete Microsoft junkie, and these instructions seemed to be geared towards long time Linux users. Could you shed a bit more light please? Thanks!
ASKER CERTIFIED SOLUTION
Avatar of slyong
slyong

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Let me give it a try, I'm serious, I've been dreaming about this issue for the past two weeks and today I'm on the verge of tears....

1. I typed in the first command, #rpm --import*.
2. I pasted:
[dries]
name=Extra Fedora rpms dries - $releasever - $basearch
baseurl=http://ftp.belnet.be/packages/dries.ulyssis.org/fedora/linux/$releasever/$basearch/dries/RPMS/
enabled=1
gpgcheck=1
into a TextEditor page and saved the file as dries.repo under /etc/yum.repos.d
3. I typed the command #yum install freetds.

What's the next step?




What is the output of
# yum install freetds

??

If you see a progress bar, then FreeTDS is installed.  You should be able to configure if by configuring /etc/freetds.conf
Oh, yes, sorry... I did see a progress bar and a question came up asking me if it was OK to install a file or something. It seemed all the packages were installed correctly. Let me try to configure it now and I'll let you know in a couple of minutes...
OK, I checked freeTDS with tsql and I got a 1> prompt. So far so good... I opened freetds.conf and added the following lines at the end of the file:

[TDS]

host = 10.7.122.28
port = 1433
tds version = 8.0

I have a bunch of different instructions on how to set this up. One of them indicates that the odbc.ini also has to be configured. Mine is empty, do I also have to add some sort of configuration or is this sufficient to connect to a MSSQL server? If so, how? I'm trying to make a connection using PHP if you could provide yet another example. Thanks!
Oh, another thing... I just opened /etc/yum.repos.d and it now has many files, whereas before I followed your instructions, it only had a few. Is this the way its supposed to be?
Please disregard my last comment, my bad...
/etc/yum.repos.d should already has a few repos before you put in the dries repos (repos stands for repositories).  It is where you can get your software install/updated.  It should be fine.  I am not very familiar with MSSQL side of the things.  Couldn't help much but, just providing you the links to the manual of FreeTDS http://www.freetds.org/userguide/.  I think you should read part 3, 4 and 6 (PHP).  You do need to change something in odbc.ini.
Yeah, that's what I've been having the main problem... Other manuals instruct you to create a DSN and to install unixODBC, that's where I find the real problem... The install instructions ask for a C++ compiler and other stuff, and being new to this whole scenario makes it quite difficult. Do you know anyone else who does have experience with MSSQL? Should I post another question on another experts site?
The unixODBC is installed together with FreeTDS when you do yum install.  May be you should put a pointer question from MSSQL area and see if someone with MSSQL and Linux experience can help.
Mmmm, let me give it a try then....
Well slyong, your suggestions really worked out great, I just followed the next instructions that I had and was able to connect to the MSSQL server and display a whole table. Here are the steps that I followed after your instructions in case somebody else like me gets lost and start pulling his/her hair out:

1. Followed slyong's second instructions detailed on his second comment to a tee.
2. Verified that freeTDS was working with the MSSQL that I wanted to connect to using the following command at root:
#tsql -S <ip address of MSSQL server> -U <password>
3. Created a file under root named tds.driver.template with the following lines:
[FreeTDS]
Description = v0.63 with protocol v8.0
Driver = /usr/lib/libtdsodbc.so.0
4. Executed the following command, which registers the ODBC driver:
#odbcinst -i -d -f tds.driver.template
5. Created a second file also under root named tds.datasource.template with the following lines:
[MSSQLTestServer]
Driver = FreeTDS
Description = <DB Description>
Trace = No
Server = <MSSQL ip address>
Port = 1433
Database = <DB name>
6. Executed the following command, which creates the ODBC data source:
# odbcinst -i -s -f tds.datasource.template -l
7. Restarted the server with the following command:
#service httpd restart
8. Connected to the server using the following command:
#isql -v MSSQLTestServer <username> <password>
9. If all went well, you should see the following screen with a SQL prompt at the end:
+---------------------------------------+
| Connected!                            |
|                                       |
| sql-statement                         |
| help [tablename]                      |
| quit                                  |
|                                       |
+---------------------------------------+
SQL>
10. Close the connection using Ctrl + C.

I wouldn't have been able to accomplish this without your help slyong. Not only were your suggestions accurate, but you also answered quickly and didn't leave me hanging with my question.  You rock!


I had another question in the Linux Setup section, Q_21895696. Feel free to post a comment and I'll award you an extra 500 pts.
Hi horalia,

Thanks for the points and glad that it works out fine.