This is a rather long message but I am stuck and am really in a bind so I wanted anyone who might be willing to point me in the right direction to have the full picture.

I recently installed MySql 4.0.13 on a Intel Linux box running Red Hat 9. I used the RPM that I found on the MySQL site. I had to remove the existing MySQL 3.23 installation prior to installing 4.0.13, which was kind of a pain but I got it to work, although it ended up in /usr/bin instead of /usr/local, as the MySQL manual suggests to put it.

I then created a database, created some tables and populated them manually using sql statements. I am able perform all db operations as expected.

Prior to installing MySQL using the provided RPM for my system, I also downloaded, unziped and untarred a binary distribution in /usr/local, as per the MySQL reference manual. Once I got the RPM install to work I never removed this. I thought this turned out to be a good thing as I could not locate the lib directory to link against from the RPM install so I used /usr/local/mysql-4.0.13-pc-linux-i686/lib to link against instead.

In a separate directory I installed a copy of the source distribution so that I could mess around with the C API w/i affecting the good version of 4.0.13 that I installed using the RPM and already have populated manually with data.

I proceeded to write a short '*.c' program that would accept command line args (database, user & password) and then connect to the database using mysql_real_connect(), print a message to the console indicating it had connected successfully, then exit using mysql_close().

I saved the source file in the same directory that the example programs that came with the source distribution (../mysql-4.0.13/client) are stored. I compiled this program using the following (note I used the library that came with the RPM that I installed earlier:

gcc -g -o mysql_connect_test mysql_connect_test.c -I ../include -L /usr/local/mysql-standard-4.0.13-pc-linux-i686/lib -lmysqlclient -lnsl -lz

The program compiled fine but when I ran it I get a segmentation fault. Thought it might have been programmer's error so I reviewed my code and it is not. I then compiled 'insert_test.c', a program that came with the source distribution and it to compiled fine using the above make line. When I ran this executable it also seg faults.

Is there something I am missing. Is it not OK to use the libraries from the standard RPM install?

Thanks for anyone help in advance.
Sean Mac Millan


-- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]



Reply via email to