DB access (ODBC?) from Linux client

DB access (ODBC?) from Linux client

Post by Arnfinn Bakk » Fri, 14 Sep 2001 06:18:30



Hi!

I'm developing a C++ application (KDevelop) that needs to access a
SQL-server (primarily mysql), but have so far been unable to get ODBC
working from my (SuSE 7.1 and RH 7.1) machines.  Have tried iodbc and
unixODBC managers with MyODBC driver. but the various testprograms
report that they cannot connect. BTW: The serverside is ok as ODBC
connection from a Win2000 PC works fine.

Can someone please set up a step-by-step description on how to set up
ODBC support on a SuSE or RH 7.1?  

Arnfinn

 
 
 

DB access (ODBC?) from Linux client

Post by Ujwal S. Sathya » Sat, 15 Sep 2001 15:20:05




Quote:> Hi!

> I'm developing a C++ application (KDevelop) that needs to access a
> SQL-server (primarily mysql), but have so far been unable to get ODBC
> working from my (SuSE 7.1 and RH 7.1) machines.  Have tried iodbc and
> unixODBC managers with MyODBC driver. but the various testprograms
> report that they cannot connect. BTW: The serverside is ok as ODBC
> connection from a Win2000 PC works fine.

> Can someone please set up a step-by-step description on how to set up
> ODBC support on a SuSE or RH 7.1?

> Arnfinn

Have you looked at the permissions in mysql? You usually have to specify
which IP addresses can connect.

Ujwal

 
 
 

DB access (ODBC?) from Linux client

Post by Arnfinn Bakk » Sun, 16 Sep 2001 17:50:04


Thank you for responding!

I'm using a dual-booted PC with Win2000 and Linux installed.  Both are
assigned the same IP-address and have the same name.  Yet, from Win2000
ODBC works fine and JDBC works fine on both platforms.  So I conclude
that the server setup is ok.

Since I posted the previous message I have succeeded in esablishing
connection after having installed the full mysql server on the local
machine.  This is obviously not what we want, but for now I can live
with that.  However, once I try to run some SQL-statement (from isql,
DataManager or my own program) the program crashes with a segmentation
fault.  

I suspect that some of MyODBC's prerequisites are missing, although the
binary RPM's have not reported any on installation.

(In my mind, the ODBC concept on Linux/Unix is virtually useless if this
is as difficult as it appears to me now. I chose ODBC for my application
hoping that this would make it easier to install, but now I have serious
doubts.)

Arnfinn



> > Hi!

> > I'm developing a C++ application (KDevelop) that needs to access a
> > SQL-server (primarily mysql), but have so far been unable to get ODBC
> > working from my (SuSE 7.1 and RH 7.1) machines.  Have tried iodbc and
> > unixODBC managers with MyODBC driver. but the various testprograms
> > report that they cannot connect. BTW: The serverside is ok as ODBC
> > connection from a Win2000 PC works fine.

> > Can someone please set up a step-by-step description on how to set up
> > ODBC support on a SuSE or RH 7.1?

> > Arnfinn

> Have you looked at the permissions in mysql? You usually have to specify
> which IP addresses can connect.

> Ujwal

 
 
 

DB access (ODBC?) from Linux client

Post by Eric P. McC » Mon, 17 Sep 2001 04:18:41


(This post apparently contains control characters, but I can't find them.)


> I'm using a dual-booted PC with Win2000 and Linux installed.  Both are
> assigned the same IP-address and have the same name.  Yet, from Win2000
> ODBC works fine and JDBC works fine on both platforms.  So I conclude
> that the server setup is ok.

Ah: you want to connect to a remote DBMS.  I should probably pay
attention, as I plan to try to get that working in about five
minutes.

Quote:> Since I posted the previous message I have succeeded in esablishing
> connection after having installed the full mysql server on the local
> machine.  This is obviously not what we want, but for now I can live
> with that.  However, once I try to run some SQL-statement (from isql,
> DataManager or my own program) the program crashes with a segmentation
> fault.  

Are you using iODBC or unixODBC (or something else) at this point?
unixODBC has some serious memory allocation problems.  I've made some
local patches to fix a few of the code-breakers, but there are still
many, many more.

I'll see if I still have the source installed, and if so I'll make a
.diff of it.  Email me if you'd like it.

Quote:> (In my mind, the ODBC concept on Linux/Unix is virtually useless if this
> is as difficult as it appears to me now. I chose ODBC for my application
> hoping that this would make it easier to install, but now I have serious
> doubts.)

ODBC was very easy for me to get working - until I compiled my program
with ccmalloc.  At which point it would no longer _start_ due to
buffer overruns, multiply-freed pointers, and all sorts of other
horrible things.  Most of them are absolutely trivial fixes, but...

In any event, if you are using MySQL, there is an API for that
specific DBMS which you should be able to use.  Most SQL APIs mirror
each other very closely, so it shouldn't require too many code
changes.

--

"I woke up this morning and realized what the game needed: pirates,
pimps, and gay furries."  - Rich "Lowtax" Kyanka

 
 
 

DB access (ODBC?) from Linux client

Post by Arnfinn Bakk » Tue, 18 Sep 2001 19:31:45


Thanks for this input!

I have now solved the problem, sort of......
I downloaded the source for MySQL and MyODBC and compiled them for
unixODBC. That made things work with unixODBC, but I still don't know
exactly what did the trick.  I'll leave that for future exploration.
The important thing now is that I can continue writing my program.

I appreciate very much such information you provide about unixODBC.
This is my first attempt at writing an ODBC based application, so your
input is very useful.  

Getting a connection to the remote DB was as easy as for the local DB.
I run MySQL on both machines.  After configuring ODBC with ODBCConfig I
used DataManager to test the connections.  On my first attempts I could
connect to the databases and even see the tabledefinitions, but one I
tried to execute some SQL it all crashed!
The re-compilation sorted that out.

I tried iODBC at first, but the tools kept crashing and I never
succeeded in getting any contact with the databases. So unixODBC seemed
a better proposition at the time.

Arnfinn


> (This post apparently contains control characters, but I can't find them.)


> > I'm using a dual-booted PC with Win2000 and Linux installed.  Both are
> > assigned the same IP-address and have the same name.  Yet, from Win2000
> > ODBC works fine and JDBC works fine on both platforms.  So I conclude
> > that the server setup is ok.

> Ah: you want to connect to a remote DBMS.  I should probably pay
> attention, as I plan to try to get that working in about five
> minutes.

> > Since I posted the previous message I have succeeded in esablishing
> > connection after having installed the full mysql server on the local
> > machine.  This is obviously not what we want, but for now I can live
> > with that.  However, once I try to run some SQL-statement (from isql,
> > DataManager or my own program) the program crashes with a segmentation
> > fault.

> Are you using iODBC or unixODBC (or something else) at this point?
> unixODBC has some serious memory allocation problems.  I've made some
> local patches to fix a few of the code-breakers, but there are still
> many, many more.

> I'll see if I still have the source installed, and if so I'll make a
> .diff of it.  Email me if you'd like it.

> > (In my mind, the ODBC concept on Linux/Unix is virtually useless if this
> > is as difficult as it appears to me now. I chose ODBC for my application
> > hoping that this would make it easier to install, but now I have serious
> > doubts.)

> ODBC was very easy for me to get working - until I compiled my program
> with ccmalloc.  At which point it would no longer _start_ due to
> buffer overruns, multiply-freed pointers, and all sorts of other
> horrible things.  Most of them are absolutely trivial fixes, but...

> In any event, if you are using MySQL, there is an API for that
> specific DBMS which you should be able to use.  Most SQL APIs mirror
> each other very closely, so it shouldn't require too many code
> changes.

> --

> "I woke up this morning and realized what the game needed: pirates,
> pimps, and gay furries."  - Rich "Lowtax" Kyanka

 
 
 

1. Linux DB with ODBC interface?

Is there a database for Linux, preferrably SQL, that has
a ODBC driver for Windows NT? I need to run a DB on a
Linux server and pull data from it to an application on
a NT Workstation client.

Thanks,

--
-Kaare

Moldenett AS, Verftsgata 10, N-6400 Molde, Norway
Phone: +47 71 21 55 55, Fax: +47 71 25 68 44, Web:
http://www.moldenett.no/

2. 3com 3c996b in dual P3 linux box

3. ODBC Relational dB for Linux?

4. /dev/mouse invalid argument

5. ODBC driver / SQL Server DB-Lib for Solaris x86

6. DS-XG Configuration Problems (Alsa)

7. ODBC *clients* for Linux?

8. Setting up a printer under RedHat7 (sigh)

9. INFORMIX ODBC CLIENT FOR LINUX ?

10. Linux ODBC Client to Windows Database Server Solutions

11. Linux ODBC Client

12. NFS clients hang redhat linux 7.3 and limbo clients accessing auspex ns2000

13. ODBC Access Driver On Linux