MySQL Lists are EOL. Please join:

List:General Discussion« Previous MessageNext Message »
From:April Escamilla Date:June 9 1999 2:52pm
Subject:Re: mysql_real_connect problem??
View as plain text  
Paul,

   Here's a cut from the c code I am using:

    10  int main()
    11  {
    12    MYSQL mysql;
    13
    14    mysql_init(&mysql);
    15    if
(!mysql_real_connect(&mysql,"host","user","passwd","db",0,NULL,0))
    16    {
    17      fprintf(stderr, "Failed to connect to database: Error:
%s\n",mysql_e
rror(&mysql));
    18    }
    19    else
    20     {
    21      printf("Connected to database. \n");
    22     }
    23  }  //end of main function


   Of course, host, user, etc have actual values in the code like ip address
etc.  I did try to remove arguments from the call and got the following
error:

>>>"mysql_connect.c", line 11: warning: improper pointer/integer
combination:
>arg #5
>>>i386ld libc.a:  can't find library libmysql.a

  Do you think this is a function problem or is a library missing?
  If I forgot to include any information at all, please let me know -- I can
happily provide it for you.

Thanks,
April


-----Original Message-----
From: Paul DuBois <paul@stripped>
To: April Escamilla <aprile@stripped>; jimf@stripped
<jimf@stripped>
Cc: mysql@stripped <mysql@stripped>
Date: Wednesday, June 09, 1999 9:44 AM
Subject: Re: mysql_real_connect problem??


>At 9:37 AM -0500 6/9/99, April Escamilla wrote:
>>Jim,
>>
>>   thanks for taking the time to respond.  I did a find on the whole
system,
>>root down, and found no file matching that name.  This was after I had
>>looked in /usr/local/lib and /lusr/local/mysql.
>>
>>   We are running mysql on a SCO unix server, release 5.  Our version of
>>mysql is 3.21.33b.  I can tell you that I wrote this c file in my home
>>directory on the
>>machine and am compiling it there.  This file is a very simple test to try
>>and connect to the mysql database using the mysql_real_connect function &
>>mysql_init --- it has no other purpose.  It prints an error if no
connection
>>is made, and a success statement if a connection occurs.  The error
message
>>is exactly as stated previously, though I will add the only other error
>>associated with it in case that
>>helps.
>>
>>>>"mysql_connect.c", line 11: warning: improper pointer/integer
combination:
>>arg #5
>>>>i386ld libc.a:  can't find library libmysql.a
>>
>>   I am reading the documentation on the C API from the Mysql reference
>>manual for version 3.23.0.  This particular error is in association with
the
>>mysql_real_connect function, which has been giving me compile time
problems
>>from the beginning.
>>   Before I began seeing this error message, there were 8 arguments (there
>>are 8 of them in the documentation stated above).  The compile time error
>>message said the following when I had those 8 arguments.
>>
>>"mysql_connect.c", line 15: warning: improper pointer/integer combination:
>>arg #5
>>"mysql_connect.c", line 15: error: prototype mismatch: 8 args passed, 7
>>expected
>>
>>  So I removed one, and tested it, and received the above error.  I think
>>this
>>problem is related to either the functions or the files themselves...Maybe
a
>>problem with our release that is known..? I am pretty new to interfacing
>>mysql with C, so any help you guys can provide would be appreciated.
>
>
>mysql_real_connect() changed from 7 arguments 8 in one of the early 3.22.xx
>releases, I think.  The older form has no database name argument.  Try
removing
>that argument from your call.  Or post your code.  (Maybe you did earlier.
If
>so, I missed it, sorry.)
>
>--
>Paul DuBois, paul@stripped
>Northern League Chronicles: http://www.snake.net/nl/
>
>---------------------------------------------------------------------
>Please check "http://www.mysql.com/Manual_chapter/manual_toc.html" before
>posting. To request this thread, e-mail mysql-thread4873@stripped
>
>To unsubscribe, send a message to the address shown in the
>List-Unsubscribe header of this message. If you cannot see it,
>e-mail mysql-unsubscribe@stripped instead.
>
>

Thread
mysql_real_connect problem??April Escamilla9 Jun
  • Re: mysql_real_connect problem??Paul DuBois9 Jun
Re: mysql_real_connect problem??April Escamilla9 Jun
  • Re: mysql_real_connect problem??Paul DuBois9 Jun
Re: mysql_real_connect problem??April Escamilla9 Jun
  • Re: mysql_real_connect problem??Paul DuBois9 Jun
  • Re: mysql_real_connect problem??Michael Widenius9 Jun
Re: mysql_real_connect problem??April Escamilla9 Jun
  • Re: mysql_real_connect problem??Paul DuBois9 Jun
Re: mysql_real_connect problem??April Escamilla9 Jun
  • Re: mysql_real_connect problem??Paul DuBois9 Jun
Re: mysql_real_connect problem??April Escamilla9 Jun
  • Re: mysql_real_connect problem??Sasha Pachev9 Jun
Re: mysql_real_connect problem??April Escamilla9 Jun
  • Re: mysql_real_connect problem??Paul DuBois10 Jun
  • Re: mysql_real_connect problem??Sasha Pachev10 Jun
Re: mysql_real_connect problem??April Escamilla10 Jun
  • Re: mysql_real_connect problem??Sasha Pachev10 Jun
Re: mysql_real_connect problem??April Escamilla10 Jun
Re: mysql_real_connect problem??April Escamilla10 Jun
Re: mysql_real_connect problem??April Escamilla10 Jun
  • Re: mysql_real_connect problem??Sasha Pachev10 Jun
Re: mysql_real_connect problem??April Escamilla10 Jun
  • Re: mysql_real_connect problem??Paul DuBois10 Jun
  • Re: mysql_real_connect problem??Sasha Pachev10 Jun
Re: mysql_real_connect problem??April Escamilla11 Jun
  • Re: mysql_real_connect problem??Sasha Pachev11 Jun