Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2422
  • Last Modified:

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!
0
horalia
Asked:
horalia
  • 11
  • 6
1 Solution
 
slyongCommented:
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
 
fridomCommented:
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
 
horaliaAuthor Commented:
Do I need a C++ compiler to do so?
0
Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

 
horaliaAuthor Commented:
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
 
slyongCommented:
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
 
horaliaAuthor Commented:
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
 
slyongCommented:
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
 
horaliaAuthor Commented:
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
 
horaliaAuthor Commented:
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
 
horaliaAuthor Commented:
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
 
horaliaAuthor Commented:
Please disregard my last comment, my bad...
0
 
slyongCommented:
/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
 
horaliaAuthor Commented:
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
 
slyongCommented:
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
 
horaliaAuthor Commented:
Mmmm, let me give it a try then....
0
 
horaliaAuthor Commented:
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
 
horaliaAuthor Commented:
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
 
slyongCommented:
Hi horalia,

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

0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 11
  • 6
Tackle projects and never again get stuck behind a technical roadblock.
Join Now