List:General Discussion« Previous MessageNext Message »
From:Tavaris Thomas Date:April 15 1999 5:57pm
Subject:fatal error on running MySQL CGI in C
View as plain text  
To whom it may concern:

I am running MySQL ver 3.22.20a
My compiler is egcs 1.1.2 on a SUN Ultra 1 with Solaris 2.6
I am trying to write CGIs to access MySQL via a web browser. (written in C)

I compiled my source code with the following command (all on one line)

gcc -I/usr/local/mysql/include/mysql -L/usr/local/mysql/lib/mysql -o test
test2.c -lmysqlclient -lsocket -lm

this compiles without errors however when I try to run "test"
I get the following error:

# ./test
ld.so.1: ./test: fatal: libmysqlclient.so.6: open failed: No such file or
directory
Killed

I know my error has to do with the mysqlclient library but can't solve it.
The ld.so.1 file exists in the /etc/lib                directory

Incidentally here is my /usr/local/mysql/lib/mysql     directory.
*******Here are the contents**********
# ls -al
total 1280
drwxr-xr-x   2 root     other        512 Apr 15 13:05 .
drwxr-xr-x   3 root     other        512 Apr  6 11:06 ..
-rw-r--r--   1 root     other      14068 Apr  6 11:06 libdbug.a
-rw-r--r--   1 root     other      29224 Apr  6 11:06 libheap.a
-rw-r--r--   1 root     other      13128 Apr  6 11:06 libmerge.a
-rw-r--r--   1 root     other     142796 Apr  6 11:06 libmysqlclient.a
-rw-r--r--   1 root     other        559 Apr  6 11:06 libmysqlclient.la
lrwxrwxrwx   1 root     other         23 Apr  6 11:06 libmysqlclient.so ->
libmysqlclient.so.6.0.0
lrwxrwxrwx   1 root     other         23 Apr 15 13:05 libmysqlclient.so.6 ->
libmysqlclient.so.6.0.0
-rw-r--r--   1 root     other     106456 Apr  6 11:06
libmysqlclient.so.6.0.0
-rw-r--r--   1 root     other      27116 Apr  6 11:06 libmystrings.a
-rw-r--r--   1 root     other     160892 Apr  6 11:06 libmysys.a
-rw-r--r--   1 root     other     106904 Apr  6 11:06 libnisam.a

*******Here is my code********

>#include "mysql.h"
>#include <stdlib.h>
>#include "/usr/local/etc/httpd/cgi-bin/NETREG/getcgi.c"
>#include <stdio.h>
>#include <string.h>
>
>
>void main() {
>    char **cgivars ;
>    int i ;
>    MYSQL mysql;
>
>    /** First, get the CGI variables into a list of strings         **/
>    cgivars= getcgivars() ;
>
>    /** Print the CGI response header, required for all HTML output. **/
>    /** Note the extra \n, to send the blank line.                  **/
>    printf("Content-type: text/html\n\n") ;
>
>    printf("<html>\n") ;
>    printf("<head><title>test Results</title></head>\n") ;
>    printf("<body>\n") ;
>
>    mysql_init(&mysql);
>
>    if (!mysql_real_connect(&mysql, "localhost", "tavaris",
>"thomas","network_registration",0,NULL,0))
>       { printf("I didn't connect to the database!\n");}
>     else { printf("I did connect to the database!\n");}
>
>    printf("</body>\n") ;
>    printf("</html>\n") ;
>
>    mysql_close(&mysql);
>}



Can anyone help?????

-Much thanks in advance.
If you need anymore info or can help please reply to

-Tavaris
tavaris@stripped


Thread
fatal error on running MySQL CGI in CTavaris Thomas15 Apr
  • Re: fatal error on running MySQL CGI in CSasha Pachev15 Apr
  • Re: fatal error on running MySQL CGI in CAldrian Gintingsuka16 Apr