bradcathey has asked for the wisdom of the Perl Monks concerning the following question:

Fellow Monks,
I 've been trying to install DBD for MySQL for 2 days and keep running into road blocks. I'm obviously a novice at this, but am learning as I go. Trying to get to module-nirvana. Anyway, the latest error:
Can't exec "mysql_config": No such file or directory at Makefile.PL li +ne 169. readline() on closed filehandle PIPE at Makefile.PL line 171. Failed to determine directory of libmysqlclient.a|libmysqlclient.so. U +se perl Makefile.PL "--libs=-L<dir> -lmysqlclient"
or
perl Makefile.PL --cflags=-I<dir>
My mysql_config file is in:
/Library/eSuite4X/MySQL4/bin
And I'm executing from:
/Library/Perl/DBD-mysql-2.1028
I have tried both:
sudo perl Makefile.PL "--libs=-L/Library/eSuite4x/mysql4/bin/ -lmysqlc +lient"
and
sudo perl Makefile.PL --cflags=-/Library/eSuite4x/mysql4/developer/inc +lude/mysql/
where my *.h files reside. I've Googled and SuperSearched for examples of how to set this up, but nothing is working. BTW, working on Mac OS 10.3 and had no problem setting up the DBI only minutes earlier. It's probably just a path problem.

Thanks in advance.

—Brad
"A little yeast leavens the whole dough."

Replies are listed 'Best First'.
Re: Problem with setting locations in Makefile.PL
by PodMaster (Abbot) on Nov 11, 2003 at 15:27 UTC
    Right on ;)

    The path to mysql_config must be in your PATH variable.

    This is what I use

    perl Makefile.PL --libs="-LC:\mysql\lib\opt -lmysqlclient"
    C:\mysql\lib\opt contains the file mysqlclient.lib, which is what you're trying to link to (i doubt the that's located in a /bin or /include directory).

    MJD says "you can't just make shit up and expect the computer to know what you mean, retardo!"
    I run a Win32 PPM repository for perl 5.6.x and 5.8.x -- I take requests (README).
    ** The third rule of perl club is a statement of fact: pod is sexy.

Re: Problem with setting locations in Makefile.PL
by hmerrill (Friar) on Nov 11, 2003 at 15:24 UTC
    I have NO experience with Mac OS, but I do have experience with DBI and DBD::mysql. The order in which things need to be installed is this:
    1. install MySQL database, *AND* make sure your can get it running and can interact with it via the "mysql" client. On Red Hat Linux, the MySQL server package is separate from the MySQL client package - on the mysql server machine I usually install all the mysql packages there are. For example, on my machine where I have MySQL up and running, I have these mysql packages installed: mysql-server-3.23.58-1.9 mysql-devel-3.23.58-1.9 mysql-3.23.58-1.9 The 'mysql-3.23.58-1.9' package contains the MySQL client. 2. make sure DBI is installed. 3. install DBD::mysql
    DBD::mysql requires that MySQL already be installed. The error you got
    Failed to determine directory of libmysqlclient.a|libmysqlclient.so +. Use perl Makefile.PL "--libs=-L<dir> -lmysqlclient"
    indicates that it can't locate the MySQL client ("libmysqlclient.so") library. So I believe you need to find the MySQL packages for Mac OS and install those, and get mysql working. Then move on to install DBI (if not already installed) and DBD::mysql.

    HTH.
Re: Problem with setting locations in Makefile.PL
by bradcathey (Prior) on Nov 11, 2003 at 15:48 UTC
    Thanks hmerrill and PodMaster. I don't have either of those two library files you mentioned. Looks like my 3rd party install from macosguru.de didn't complete the job. I'll go back and install MySQL myself (a la hmerrill's instructions) and see if that doesn't put *what* I need *where* I need it. Whew!

    —Brad
    "A little yeast leavens the whole dough."
      I found this page on the mysql website:
      http://www.mysql.com/downloads/mysql-4.0.html
      There's a section on that page titled "MAC OS X Packages Installer downloads", and one right after that titled "MAC OS X downloads". Maybe one of those would suit your needs.