You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@apr.apache.org by koszi <ko...@mail.tvnet.hu> on 2006/05/02 02:21:37 UTC

Re: apr_dbd_mysql.c

Hello folx,
I am experiencing similar problems, hope here is the right place for this...
My environment:
-UHU Linux 1.2 Office (Hungarian distro, Debian clone)
-MySQL Server (Ver 14.12 Distrib) 5.0.20 from source
Wanted to implement MySQL based user authentication under Apache:
-Installed apr 1.2.7 under /usr/local/apr : ./configure
--prefix=/usr/local/apr
-Got apr_dbd_mysql.c from their site, placed it under the source directory
in dbd as advised and Installed ap-util 1.2.7 under /usr/local/apr-util: 

****************************************************************************************************
./configure --with-mysql=/usr/local/include/mysql --with-apr=/usr/local/apr
--with-LDFLAGS=-L/usr/local/lib/mysql --prefix=/usr/local/apr-util
checking build system type... i686-pc-linux-gnu
checking host system type... i686-pc-linux-gnu
checking target system type... i686-pc-linux-gnu
checking for a BSD-compatible install... /bin/install -c
checking for working mkdir -p... yes
APR-util Version: 1.2.7
checking for chosen layout... apr-util
Applying apr-util hints file rules for i686-pc-linux-gnu
checking for APR... yes
  setting CC to "gcc"
  setting CPP to "gcc -E"
  setting CFLAGS to " -g -O2 -pthread"
  setting CPPFLAGS to " -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE
-D_LARGEFILE64_SOURCE"
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ANSI C... none needed
checking how to run the C preprocessor... gcc -E
checking for egrep... grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for ldap support...
checking for default DBM... sdbm (default)
checking libpq-fe.h usability... no
checking libpq-fe.h presence... no
checking for libpq-fe.h... no
configure: checking for mysql in /usr/local/include/mysql
checking mysql.h usability... no
checking mysql.h presence... no
checking for mysql.h... no
checking mysql/mysql.h usability... yes
checking mysql/mysql.h presence... yes
checking for mysql/mysql.h... yes
checking for mysql_init in -lmysqlclient_r... no
checking sqlite3.h usability... no
checking sqlite3.h presence... no
checking for sqlite3.h... no
checking sqlite.h usability... no
checking sqlite.h presence... no
checking for sqlite.h... no
checking for Expat in /usr... yes
  setting APRUTIL_EXPORT_LIBS to "-lexpat"
  setting APRUTIL_LDFLAGS to ""
  setting APRUTIL_LIBS to "/usr/lib/libexpat.la"
checking iconv.h usability... yes
checking iconv.h presence... yes
checking for iconv.h... yes
checking for type of inbuf parameter to iconv... char **
checking for iconv.h... (cached) yes
checking langinfo.h usability... yes
checking langinfo.h presence... yes
checking for langinfo.h... yes
checking for nl_langinfo... yes
checking for CODESET in langinfo.h... yes
checking for library containing crypt... -lcrypt
checking if system crypt() function is threadsafe... no
checking for crypt_r... yes
checking style of crypt_r... none
  adding "/usr/local/apr/lib/libapr-1.la" to APRUTIL_LIBS
  adding "-lrt" to APRUTIL_LIBS
  adding "-lcrypt" to APRUTIL_LIBS
  adding "-lpthread" to APRUTIL_LIBS
  adding "-ldl" to APRUTIL_LIBS
configure: creating ./config.status
config.status: creating Makefile
config.status: creating export_vars.sh
config.status: creating build/pkg/pkginfo
config.status: creating apr-util.pc
config.status: creating apu-1-config
config.status: creating include/private/apu_select_dbm.h
config.status: creating include/apr_ldap.h
config.status: creating include/apu.h
config.status: creating include/apu_want.h
config.status: creating test/Makefile
config.status: creating include/private/apu_config.h
config.status: include/private/apu_config.h is unchanged
config.status: executing default commands
****************************************************************************************************
apr_dbd_mysql.o IS actually generated, but not put anywhere in the target
directories. Where should it be placed normally upon installation? What
worries me the most is this  "checking for mysql_init in -lmysqlclient_r...
no"... I looked into the generated config script file and there, mysql_init
is tested like this:

...
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char mysql_init ();
int
main ()
{
mysql_init ();
  ;
  return 0;
}
_ACEOF
...
As I was led to understand,  the actual declaration of this is MYSQL*
mysql_init(MYSQL* mysql)...

Eventually:
-Installed apache 2.2.0:   ./configure --enable-dbd --enable-authn-dbd
--with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util
(After some googling I gathered that installing apr separately is supposed
to be the "safe way")
And after starting apache, I get this nasty  DBD: No driver for mysql  thing
:-(
Please HELP!
TIA+BR
Peter.

--
View this message in context: http://www.nabble.com/apr_dbd_mysql.c-t1451411.html#a4172297
Sent from the APR Dev (Apache Portable Runtime) forum at Nabble.com.


Re: apr_dbd_mysql.c

Posted by Bojan Smojver <bo...@rexursive.com>.
On Tue, 2006-05-02 at 13:51 -0700, koszi wrote:

> please note the difference:
> 1)gcc -o conftest  -g -O2 -pthread -I/usr/local/include/mysql/include 
> conftest.c -lmysqlclient_r  -L/usr/local/include/mysql/lib    *********this
> is the generated original, won't work
> 2) gcc -o config  -g -O2 -pthread -I/usr/local/include/mysql/include
> -lmysqlclient -L/usr/local/lib/mysql  config.c ************** changed order
> of params, and used -lmysqlclient instead of -lmysqlclient_r, this one DOES
> work.
> Any ideas, comments please? Or anyone point me to other threads/forums would
> be very helpfull. Thanks for the attn,

Which MySQL libraries do you have on your system? The ones with _r or
without? I think the _r libraries are probably something a threaded APU
would like to pick up (because they are thread safe).

How was your MySQL built? Are the files there at all, or are they just
in the wrong location?

-- 
Bojan


Re: apr_dbd_mysql.c

Posted by koszi <ko...@mail.tvnet.hu>.
APU_HAVE_MYSQL is undefined, so the entire source of apr_dbd_mysql.c is
skipped because of the #ifdef APU_HAVE_MYSQL directive. So, formally the
object file is present in the library, but it contains no symbols. 
I do use the --with-mysql=[mysql base dir] option for apr-util configure
file. But MySQL configure appends an extra "/mysql" to the end of --libdir
and --includedir, and apr-util's configure script appends  /lib and /include
to the directory passed to it in --with-mysql=... Therefore, MsSQL config
script always puts stuff in dirs ending in /mysql, and apr-util script
always looks for it in dirs ending with /lib and /include (see my earlier
msgs)
APRUTIL_LDFLAGS in apr-util's Makefile is empty after running the configure
script btw. I think a tweak in configure is necessary to set APU_HAVE_MYSQL
to true somehow and to add explicitly paths to mysql libdir and includedir.
BR
Peter.
--
View this message in context: http://www.nabble.com/apr_dbd_mysql.c-t1451411.html#a4226829
Sent from the APR Dev (Apache Portable Runtime) forum at Nabble.com.


Re: apr_dbd_mysql.c

Posted by Nick Kew <ni...@webthing.com>.
On Thursday 04 May 2006 06:37, koszi wrote:
> Well actually, there's nothing. 2 object names with mysql
> apr_dbd_mysql.o:
> lt1-apr_dbd_mysql.o:
> both have no symbols listed whatsoever.

So you compiled without mysql support, exactly as the
error message said.

> Sent from the APR Dev (Apache Portable Runtime) forum at Nabble.com

wtf is this?

-- 
Nick Kew

Re: apr_dbd_mysql.c

Posted by koszi <ko...@mail.tvnet.hu>.
"nm -D libaprutil-1.a"     says 
"apr_buckets_pipe.o:
nm: apr_buckets_pipe.o: No symbols"

BR
Peter.

--
View this message in context: http://www.nabble.com/apr_dbd_mysql.c-t1451411.html#a4224498
Sent from the APR Dev (Apache Portable Runtime) forum at Nabble.com.


Re: apr_dbd_mysql.c

Posted by Bojan Smojver <bo...@rexursive.com>.
Quoting koszi <ko...@mail.tvnet.hu>:

>
> Well actually, there's nothing. 2 object names with mysql
> apr_dbd_mysql.o:
> lt1-apr_dbd_mysql.o:
> both have no symbols listed whatsoever.

Try "nm -D".

-- 
Bojan

Re: apr_dbd_mysql.c

Posted by koszi <ko...@mail.tvnet.hu>.
Well actually, there's nothing. 2 object names with mysql
apr_dbd_mysql.o:
lt1-apr_dbd_mysql.o:
both have no symbols listed whatsoever.

--
View this message in context: http://www.nabble.com/apr_dbd_mysql.c-t1451411.html#a4223356
Sent from the APR Dev (Apache Portable Runtime) forum at Nabble.com.


Re: apr_dbd_mysql.c

Posted by Nick Kew <ni...@webthing.com>.
On Wednesday 03 May 2006 22:35, koszi wrote:
> "DBD no driver for mysql still keeps coming"...

Looks like you haven't compiled the mysql driver.
What do you see if you grep for mysql in the output of nm on your libaprutil?


-- 
Nick Kew

Re: apr_dbd_mysql.c

Posted by koszi <ko...@mail.tvnet.hu>.
"DBD no driver for mysql still keeps coming"...  
here is a part of apache's httpd.conf involving dbd mysql authn:
...
DBDriver mysql

DBDParams "dbname=vizsga user=root password=bigsecret"

#Parameters for Connection Pool Management
DBDMin  1
DBDKeep 2
DBDMax  10
DBDExptime 60


<Directory "/var/www/html"> 

    AllowOverride None 
    Order allow,deny 
    Allow from all 

    #mod_auth configuration for authn_dbd
    AuthType Basic
    AuthName "Vizsga"
    AuthBasicProvider dbd

    #authz configuration
    Require valid-user

    #SQL query to verify a user
    #(note: DBD drivers recognise both stdio-like %s and native syntax)
    AuthDBDUserPWQuery "select eha from users where login_name = %s"
    
</Directory> 
...
This suggests that dbd auth is active. Maybe this is not an install problem?
I looked into libaprutil-1.a archive, and apr_dbd_mysql.o IS in fact listed
there... Oh well :-(
--
View this message in context: http://www.nabble.com/apr_dbd_mysql.c-t1451411.html#a4219002
Sent from the APR Dev (Apache Portable Runtime) forum at Nabble.com.


Re: apr_dbd_mysql.c

Posted by koszi <ko...@mail.tvnet.hu>.
OK just for the record for people googling around for this stuff 
mod_authn_dbd  apr_dbd_mysql apache 2.2.0 MySQL 5.0.20 apr 1.2.7 apr-util
1.2.7
Mysql's encrypt does the. trick. It's either 
1. you use "select encrypt(passwordfield) from..."  in AuthDBDUserPWQuery
directive, if you store passwords in plain text (perhaps not a good idea) 
2 or use "select password from ...'" , in that case you need to store
passwords in encrypted format like 'insert into usertable
encrypt('secret')',..."
BR
Peter.
--
View this message in context: http://www.nabble.com/apr_dbd_mysql.c-t1451411.html#a4267381
Sent from the APR Dev (Apache Portable Runtime) forum at Nabble.com.


Re: apr_dbd_mysql.c

Posted by koszi <ko...@mail.tvnet.hu>.
Any ideas how to get apache to log the password supplied by the user? I
checked log entry format strings in apache doc, but password is not
mentioned as an option. Or alternatively, how do I call the apache logging
routine from inside apr/apu source code? Can it log an arbitrary string of
my choosing? I am really really curious what password is forwarded to apache
over the network, and what  is passed on to mod_authn_dbd, and eventually,
to mysql driver. Btw I am not sure what to store in the password field of
the table, and how to retrieve it with the select statement. Do I apply an
encryption/decryption before/after? 
I mean like "update users set passwordfield=md4('******') where user_id=1"
or such kind of stuff? Please help I am really at a loss with this, I need
to come up with something asap.
TIA+BR
Peter.
--
View this message in context: http://www.nabble.com/apr_dbd_mysql.c-t1451411.html#a4259375
Sent from the APR Dev (Apache Portable Runtime) forum at Nabble.com.


Re: apr_dbd_mysql.c

Posted by koszi <ko...@mail.tvnet.hu>.
Is there an API-wide debug facility in apr/apr-util? If there is, how can it
be turned on? Re-configure/rebuild/other? And can it be used to gather info
about random variables into,say, a predefined file or something?
--
View this message in context: http://www.nabble.com/apr_dbd_mysql.c-t1451411.html#a4258485
Sent from the APR Dev (Apache Portable Runtime) forum at Nabble.com.


Re: apr_dbd_mysql.c

Posted by koszi <ko...@mail.tvnet.hu>.
Thank you, now looks like the new connection string works just fine. Hope I
am not very far away now from setting up the mysql authentication system.
There are still some problems, however.
Here is the query log of mysql:
...
060505 17:15:16	     35 Connect     root@localhost on vizsga
		              35 Prepare     [1] 
060505 17:15:31	     32 Execute     [1] select eha from users where
login_name = 'koszi'
...
The above query returns the password of the user correctly when issued from
the mysql console. However apache fails to let me in, I find this in the
error_log:
[Fri May 05 17:15:31 2006] [error] [client 127.0.0.1] user koszi:
authentication failure for "/": Password Mismatch
What can be the problem? The field contains the password in plain text
format btw.
TIA+BR
Peter.
--
View this message in context: http://www.nabble.com/apr_dbd_mysql.c-t1451411.html#a4248235
Sent from the APR Dev (Apache Portable Runtime) forum at Nabble.com.


Re: apr_dbd_mysql.c

Posted by Nick Kew <ni...@webthing.com>.
On Friday 05 May 2006 00:03, Bojan Smojver wrote:
> Quoting koszi <ko...@mail.tvnet.hu>:
> > DBDParams "dbname=vizsga user=root password=xxxx"
>
> DBDParams param1=value1[,param2=value2
>
> Maybe?

No, spaces are fine.  But it's "pass", not "password" that the
MySQL driver recognises.

I think that's an outdated mod_dbd - IIRC someone suppressed
reporting of the parameter string there so as not to expose
passwords in a log.

-- 
Nick Kew

RE: apr_dbd_mysql.c

Posted by Peter Wojciechowski <pw...@valueclick.com>.
Most welcome, this should get it connecting for you.

DBDriver mysql
DBDMax 20
DBDPersist 1
DBDExptime 3600
DBDParams "host=localhost,user=***,pass=***,dbname=***,sock=***"

-Peter

-----Original Message-----
From: Bojan Smojver [mailto:bojan@rexursive.com]
Sent: Thu 5/4/2006 4:03 PM
To: APR Development List
Subject: Re: apr_dbd_mysql.c
 
Quoting koszi <ko...@mail.tvnet.hu>:

> DBDParams "dbname=vizsga user=root password=xxxx"

DBDParams param1=value1[,param2=value2

Maybe?

-- 
Bojan


Re: apr_dbd_mysql.c

Posted by Bojan Smojver <bo...@rexursive.com>.
Quoting Bojan Smojver <bo...@rexursive.com>:

>> DBDParams "dbname=vizsga user=root password=xxxx"
>
> DBDParams param1=value1[,param2=value2
>
> Maybe?

Nah, scrap that! Both forms should work for MySQL (delimiters are  
defined as " \r\n\t;|,").

BTW, documentation for mod_dbd appears to be misleading - the form for  
DBDParams is whatever the underlying APU DBD driver can parse, which  
is not necessarily a comma separated list.

-- 
Bojan

Re: apr_dbd_mysql.c

Posted by Bojan Smojver <bo...@rexursive.com>.
Quoting koszi <ko...@mail.tvnet.hu>:

> DBDParams "dbname=vizsga user=root password=xxxx"

DBDParams param1=value1[,param2=value2

Maybe?

-- 
Bojan

Re: apr_dbd_mysql.c

Posted by koszi <ko...@mail.tvnet.hu>.
WOW that was THE THING. Thank you soooo much!
Apache is now trying to authenticate me. 


I get an error upon connection, here are the apache error_log
...
[Fri May 05 00:55:30 2006] [crit] DBD: Can't connect to mysql[dbname=vizsga
user=root password=xxxx]
[Fri May 05 00:55:30 2006] [crit] DBD Pool: failed to initialise
[Fri May 05 00:55:30 2006] [crit] DBD: Can't connect to mysql[dbname=vizsga
user=root password=xxxx]
[Fri May 05 00:55:30 2006] [crit] DBD Pool: failed to initialise
[Fri May 05 00:55:30 2006] [crit] DBD: Can't connect to mysql[dbname=vizsga
user=root password=xxxx]
[Fri May 05 00:55:30 2006] [crit] DBD Pool: failed to initialise
[Fri May 05 00:55:30 2006] [crit] DBD: Can't connect to mysql[dbname=vizsga
user=root password=xxxx]
[Fri May 05 00:55:30 2006] [crit] DBD Pool: failed to initialise
[Fri May 05 00:55:30 2006] [crit] DBD: Can't connect to mysql[dbname=vizsga
user=root password=xxxx]
[Fri May 05 00:55:30 2006] [crit] DBD Pool: failed to initialise
[Fri May 05 00:55:55 2006] [crit] DBD: Can't connect to mysql[dbname=vizsga
user=root password=xxxx]
[Fri May 05 00:55:55 2006] [crit] DBD Pool: failed to initialise
[Fri May 05 00:56:02 2006] [crit] DBD: Can't connect to mysql[dbname=vizsga
user=root password=xxxx]
[Fri May 05 00:56:02 2006] [crit] DBD Pool: failed to initialise
[Fri May 05 00:56:02 2006] [error] [client 127.0.0.1] Error looking up koszi
in database
...
Here is the relevant part of my httpd.conf:

###########################################################

DBDriver mysql

#Connection string: database name and login credentials
DBDParams "dbname=vizsga user=root password=xxxx"

#Parameters for Connection Pool Management
DBDMin  1
DBDKeep 2
DBDMax  10
DBDExptime 60


<Directory "/var/www/html"> 

    AllowOverride None 
    Order allow,deny 
    Allow from all 

    #mod_auth configuration for authn_dbd
    AuthType Basic
    AuthName "Vizsga"
    AuthBasicProvider dbd

    #authz configuration
    Require valid-user

    #SQL query to verify a user
    #(note: DBD drivers recognise both stdio-like %s and native syntax)
    AuthDBDUserPWQuery "select eha from users where login_name = %s"
    
</Directory> 

Any ideas about this one please?  Is the config OK or am I screwing up
something here? I am absoltely sure about credentials.
Thanks guys you have been very helpful
Hugs
Peter.


Peter Wojciechowski wrote:
> 
> Try this link http://dweller.dwellersoul.com/apr/apr-util_dbd.m4.patch
> 
--
View this message in context: http://www.nabble.com/apr_dbd_mysql.c-t1451411.html#a4238357
Sent from the APR Dev (Apache Portable Runtime) forum at Nabble.com.


Re: apr_dbd_mysql.c

Posted by Peter Wojciechowski <pw...@valueclick.com>.
Try this link http://dweller.dwellersoul.com/apr/apr-util_dbd.m4.patch

-Peter


On 5/4/06 12:45 AM, "koszi" <ko...@mail.tvnet.hu> wrote:

> 
> Sorry how do I see attachments? I dont seem to get one.
> --
> View this message in context:
> http://www.nabble.com/apr_dbd_mysql.c-t1451411.html#a4224583
> Sent from the APR Dev (Apache Portable Runtime) forum at Nabble.com.


Re: apr_dbd_mysql.c

Posted by koszi <ko...@mail.tvnet.hu>.
Sorry how do I see attachments? I dont seem to get one. 
--
View this message in context: http://www.nabble.com/apr_dbd_mysql.c-t1451411.html#a4224583
Sent from the APR Dev (Apache Portable Runtime) forum at Nabble.com.


Re: apr_dbd_mysql.c

Posted by Peter Wojciechowski <pw...@valueclick.com>.
Probably messy but here is what I had done.  It checks for the required
files in PREFIX/lib and PREFIX/lib/mysql, same for the include dir.

-Peterr


On 5/3/06 1:02 PM, "Bojan Smojver" <bo...@rexursive.com> wrote:

> On Wed, 2006-05-03 at 08:01 -0700, koszi wrote:
> 
>> Any ideas, similar experiences, a workaround?
> 
> Quick and dirty - edit the Makefile located in apr-util directory (look
> for APRUTIL_LDFLAGS) and correct the bogus stuff. Then run make/make
> install.
> 
> This may be a bug after all. Maybe we should be using mysql_config
> instead?
> 
> I'll have a closer look...


Re: apr_dbd_mysql.c

Posted by Bojan Smojver <bo...@rexursive.com>.
On Wed, 2006-05-03 at 08:01 -0700, koszi wrote:

> Any ideas, similar experiences, a workaround?

Quick and dirty - edit the Makefile located in apr-util directory (look
for APRUTIL_LDFLAGS) and correct the bogus stuff. Then run make/make
install.

This may be a bug after all. Maybe we should be using mysql_config
instead?

I'll have a closer look...

-- 
Bojan


Re: apr_dbd_mysql.c

Posted by koszi <ko...@mail.tvnet.hu>.
Hello guys!
Thanks very much for your help.
I guess I am just about to localise the source of the problem.
MySQL 5.0 configure script has options for base directories
--prefix=...(PREFIX) and --exec-prefix=...(EPREFIX)  Now the help says: 
...
--libdir=DIR  object code libraries[EPREFIX/lib]
...
--inludedir=DIR C header files [PREFIX/include]
( [] meaning defaults )

But it looks like actually the stuff is put to EPREFIX/lib/mysql and
EPREFIX/include instead. On the other hand, the apr-util configure script
requires --with-mysql=... (Btw what do I put here, EPREFIX or PREFIX, if
those happen to be different?) and whatever you put here, is extended with
/lib and /include respectively. E.g. if you say --with-mysql=/mysql then
apr-lib configure will search in  /mysql/lib and /mysql/include in vainl
because necessary files are actually in /mysql/include/mysql and
/mysql/include/mysql. I also tried finetuning mysql installer with
--libdir=... or --includedir=... , but ../mysql is added nevertheless. 
Any ideas, similar experiences, a workaround?
Thanks again
BR
Peter.
--
View this message in context: http://www.nabble.com/apr_dbd_mysql.c-t1451411.html#a4211898
Sent from the APR Dev (Apache Portable Runtime) forum at Nabble.com.


Re: apr_dbd_mysql.c

Posted by Peter Wojciechowski <pw...@valueclick.com>.
The _r libraries are reentrant and needed for a threaded server.  Add
--enable-thread-safe-client to mysqls configure script, rebuild and try
again.

-Peter


On 5/2/06 1:51 PM, "koszi" <ko...@mail.tvnet.hu> wrote:

> 
> Sorry to bother you again with this. I checked configure script output for
> apr-util in the file config.log:
> ...
> configure:33398: checking for mysql_init in -lmysqlclient_r
> configure:33428: gcc -o conftest  -g -O2 -pthread
> -I/usr/local/include/mysql/include  conftest.c -lmysqlclient_r
> -L/usr/local/include/mysql/lib  >&5
> /usr/bin/ld: cannot find -lmysqlclient_r
> collect2: ld returned 1 exit status
> configure:33434: $? = 1
> ...
> please note the difference:
> 1)gcc -o conftest  -g -O2 -pthread -I/usr/local/include/mysql/include
> conftest.c -lmysqlclient_r  -L/usr/local/include/mysql/lib    *********this
> is the generated original, won't work
> 2) gcc -o config  -g -O2 -pthread -I/usr/local/include/mysql/include
> -lmysqlclient -L/usr/local/lib/mysql  config.c ************** changed order
> of params, and used -lmysqlclient instead of -lmysqlclient_r, this one DOES
> work.
> Any ideas, comments please? Or anyone point me to other threads/forums would
> be very helpfull. Thanks for the attn,
> BR
> Peter.
> 
> --
> View this message in context:
> http://www.nabble.com/apr_dbd_mysql.c-t1451411.html#a4199439
> Sent from the APR Dev (Apache Portable Runtime) forum at Nabble.com.


Re: apr_dbd_mysql.c

Posted by koszi <ko...@mail.tvnet.hu>.
Sorry to bother you again with this. I checked configure script output for
apr-util in the file config.log:
...
configure:33398: checking for mysql_init in -lmysqlclient_r
configure:33428: gcc -o conftest  -g -O2 -pthread
-I/usr/local/include/mysql/include  conftest.c -lmysqlclient_r 
-L/usr/local/include/mysql/lib  >&5
/usr/bin/ld: cannot find -lmysqlclient_r
collect2: ld returned 1 exit status
configure:33434: $? = 1
...
please note the difference:
1)gcc -o conftest  -g -O2 -pthread -I/usr/local/include/mysql/include 
conftest.c -lmysqlclient_r  -L/usr/local/include/mysql/lib    *********this
is the generated original, won't work
2) gcc -o config  -g -O2 -pthread -I/usr/local/include/mysql/include
-lmysqlclient -L/usr/local/lib/mysql  config.c ************** changed order
of params, and used -lmysqlclient instead of -lmysqlclient_r, this one DOES
work.
Any ideas, comments please? Or anyone point me to other threads/forums would
be very helpfull. Thanks for the attn,
BR
Peter.

--
View this message in context: http://www.nabble.com/apr_dbd_mysql.c-t1451411.html#a4199439
Sent from the APR Dev (Apache Portable Runtime) forum at Nabble.com.