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

Scenario:


Windows installation Cygwin
My SQL? 5.0 downloaded, configured and installed from the Windows package.

mysql command line utility fails to run 100% under cygwin, but one can live with it. A sudden urge to hack some Perl scripts with My SQL stuff


Solution:

perl -MCPAN -e'install DBI::DBD' perl -MCPAN -e'install DBD::mysql'

Problems:

DBD::mysql fails to compile claiming it Can't exec "mysql_config": No such file or directory at Makefile.PL

Solution:

Download the My SQL? source code (.tar.gz) from http://dev.mysql.com/downloads/mysql/5.0.html

Unpack it to a temporary location

./configure --prefix=/usr/local/mysql --without-server

I get stuck here.... no matter how many times I re-download , re -gunzip , re - tar (untar) ,.... It just DOESNOT ./.configure!!!!!

what should I do??? PLS HELP ME.. like Hollie and Prasad suggested.. I have started to dwonload all the modules that I need.. but now what do I do??

make make install
[this is documented in the DBD::Mysql INSTALL file (here), but who RTFM anyway?]
By this time, you will have a beautiful set of mysql command line util +ities compiled under Cygwin on /usr/local/mysql cd .cpan/build/DBD-mysql-3.0002/ cp /usr/local/mysql/bin/mysql_config . perl Makefile.PL --testhost=127.0.0.1 (this will give you a couple of errors regarding missing header files, + mysqld_error.h and possibly others. open the offending file, change +the #include <file.h> to #include "file.h". The missing files are sti +ll on the My SQL? source code location and should be copied here. )

Thanks...
PS: The above mentioned sequence is taken from another place where someone had the same problem which got solved... but why would it not happen here with me??!!

Sweta.

20060627 Janitored by Corion: Added formatting, code tags, removed excess whitespace, linkified link as per Writeup Formatting Tips

Replies are listed 'Best First'.
Re: DBD --- not Installing!
by Corion (Patriarch) on Jun 27, 2006 at 07:45 UTC

    This is a MySQL installation problem.

    This is a Perl forum and we don't support MySQL much. You don't even tell us how ./configure fails for you, so how do you expect us to help you?

      It says there is no file called configure ( which when I checked is true... there is no such file..) Thats why I have been asking people if they know how to work around this one... and I am aware that this is a perl forum.. I am having trouble with working on MYSQL using Perl... Otherwise MYSQL works just fine.. Thanks.

        If there is no configure file, then you didn't unpack the archive properly. Or maybe you are in the wrong directory. Or maybe the tarball you downloaded didn't include the configure file. There are many reasons why this might be so, but none of them are related to Perl.

        It seems to me that you are trying to get DBD::MySQL working under Perl on Win32. Are you using the cygwin build of Perl or are you using ActiveState Perl?

        If you're using ActiveState Perl, then a much easier way might be to find a precompiled PPM to access MySQL.

        If you're using cygwin Perl (and I advise you against it unless there are other factors coming into play), then you will have to get DBD::MySQL to compile by configuring the MySQL source code and setting up the proper paths. If you get a problem during the configuring of MySQL, the MySQL forums are a much more likely place to find help than Perlmonks.

Re: DBD --- not Installing!
by davorg (Chancellor) on Jun 27, 2006 at 07:59 UTC

    Sounds to me like you're making your life far harder than it needs to be. MySQL is available in pre-built binary versions for Windows from the MySQL web site and the Activestate PPM repository includes builds of both DBI and DBD::mysql. I'm not sure why you'd want to install all of this stuff the hard way.

    --
    <http://dave.org.uk>

    "The first rule of Perl club is you do not talk about Perl club."
    -- Chip Salzenberg

      I am aware of that too.. I am using those binaries only and I have also set paths to those binaries explicitly just in case that was a problem. When it said mysql_config not found.. I shifted the file itself to the same directory and DBD's and it still doesn't work. I check out one link sent to me yesterday by someone from this very forum having the exact same problem .. but that doesn't resolve this problem either... Thanks.