Solved

Installing an ODBC connection in Fedora Core 5

Posted on 2006-06-22
18
2,412 Views
Last Modified: 2013-12-06
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!
0
Comment
Question by:horalia
  • 11
  • 6
18 Comments
 
LVL 24

Expert Comment

by:slyong
ID: 16965355
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
0
 
LVL 24

Expert Comment

by:fridom
ID: 16966503
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
0
 

Author Comment

by:horalia
ID: 16970438
Do I need a C++ compiler to do so?
0
 

Author Comment

by:horalia
ID: 16970504
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!
0
 
LVL 24

Accepted Solution

by:
slyong earned 500 total points
ID: 16972537
Ok let's try this:

# rpm --import http://dries.studentenweb.org/rpm/RPM-GPG-KEY.dries.txt

create the file in /etc/yum.repos.d/dries.repo with the following contents:
[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

Then issue the command:

# yum install freetds

Since rpms are binaries, you don't have to have a compiler.  I am not sure about the solution from Friedrich, if it is a source distribution, you need to have the compiler and the toolchains to configure and compile it.
0
 

Author Comment

by:horalia
ID: 16972938
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?




0
 
LVL 24

Expert Comment

by:slyong
ID: 16973019
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
0
 

Author Comment

by:horalia
ID: 16973034
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...
0
 

Author Comment

by:horalia
ID: 16973196
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!
0
Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 

Author Comment

by:horalia
ID: 16973208
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?
0
 

Author Comment

by:horalia
ID: 16973213
Please disregard my last comment, my bad...
0
 
LVL 24

Expert Comment

by:slyong
ID: 16973216
/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.
0
 

Author Comment

by:horalia
ID: 16973267
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?
0
 
LVL 24

Expert Comment

by:slyong
ID: 16973286
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.
0
 

Author Comment

by:horalia
ID: 16973293
Mmmm, let me give it a try then....
0
 

Author Comment

by:horalia
ID: 16973440
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!


0
 

Author Comment

by:horalia
ID: 16973450
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.
0
 
LVL 24

Expert Comment

by:slyong
ID: 16974155
Hi horalia,

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

0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Setting up Secure Ubuntu server on VMware 1.      Insert the Ubuntu Server distribution CD or attach the ISO of the CD which is in the “Datastore”. Note that it is important to install the x64 edition on servers, not the X86 editions. 2.      Power on th…
Linux users are sometimes dumbfounded by the severe lack of documentation on a topic. Sometimes, the documentation is copious, but other times, you end up with some obscure "it varies depending on your distribution" over and over when searching for …
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now