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

I'm having trouble installing DBD-Mysql on cygwin -should I forget about cygwin because it seems like so much hassle to me.
I've installed DBI on cygwin and it works -
#! /usr/bin/perl -w use strict; use DBI; print "Here's a list of DBI drivers:\n"; my @available_drivers = DBI->available_drivers('quiet'); my $driver; foreach $driver (@available_drivers) { print "$driver\n"; }

and I got ExampleP and Proxy as output.
I then untarred DBD-mysql-2.1026.tar.gz and when I tried to run perl Makefile.pl, I got "cannot exec mysql-config". I then looked at INSTALL.html and it said to run
configure --without-server
when you dont have Mysql on your machine, but I got something like this in return - "Configure" command not found. I ran both perl Makefile.pl and configure --without-server from within the directory - /home/Administrator/DBD-mysql-2.1026
So I've no idea what to do now. All I want to do is run my scripts on my PC, and allow them to connect to a mysql database which is setup and working on another machine.
What should I do
Thanks.

Replies are listed 'Best First'.
Re: Cant install DBD-Mysql
by hardburn (Abbot) on Mar 06, 2003 at 16:52 UTC

    To compile DBD::mysql, you need to have the MySQL development headers. These are needed to compile the C code underneath the Perl code against the MySQL library. I think you need to install a basic MySQL binary package and point the DBD::mysql installation to the 'include' directory in the MySQL directory.

    ----
    Reinvent a rounder wheel.

    Note: All code is untested, unless otherwise stated

Re: Cant install DBD-Mysql
by PodMaster (Abbot) on Mar 06, 2003 at 16:56 UTC
    Install DBD::mysqlPP, the PurePerl version of DBD::mysql. If you still want DBD::mysql, you'll have to pass the appropriate options to Makefile.PL, like it says
    E:\new\DBD-mysql-2.1026>perl makefile.pl --help Usage: perl makefile.pl [options] Possible options are: --cflags=<flags> Use <flags> for running the C compiler; defau +lts to the value of "mysql_config --cflags" --libs=<libs> Use <libs> for running the linker; defaults to the value of "mysql_config --libs" --testdb=<db> Use the database <db> for running the test su +ite; defaults to test --testuser=<user> Use the username <user> for running the test +suite; defaults to no username --testpassword=<pwd> Use the password <pwd> for running the test s +uite; defaults to no password --testhost=<host> Use <host> as a database server for running t +he test suite; defaults to localhost. --testport=<port> Use <port> as the port number of the database +; by default the port number is choosen from th +e mysqlclient library --nocatchstderr Supress using the "myld" script that redirect +s STDERR while running the linker. --help Print this message and exit All options may be configured on the command line. If they are not present on the command line, then mysql_config is called: mysql_config --cflags mysql_config --libs mysql_config --testdb and so on. See the INSTALL.html file for details. E:\new\DBD-mysql-2.1026>
    You need to install mysql client libraries, and then do something like
    perl Makefile.PL --cflags=-IC:\mysql\include --libs="-LC:\mysql\lib\op +t -lmysqlclient"
    You'll have to adjust for your environment.

    You'll want to read ExtUtils::MakeMaker, since %97 of Makefile.PL's use ExtUtils::MakeMaker.


    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.6x+5.8x. I take requests.
    ** The Third rule of perl club is a statement of fact: pod is sexy.

Re: Cant install DBD-Mysql
by dorko (Prior) on Mar 07, 2003 at 09:27 UTC
    Take this with a grain of salt. I think it's correct, but I haven't done this. It's quite untested. Use at your own risk. Backup everything first. You've been warned.

    Both hardburn and PodMaster are correct - you've got to have parts of the MySQL server installed before you can install DBD::Mysql. (hardburn called them "MySQL development headers" and PodMaster called them "mysql client libraries.")

    To do this, download the source tarball for MySQL from here.
    (Since you're using Cygwin, I'm not sure if you should get the "Tarball" or the "Windows Source")
    Untar/unzip it somewhere in your Cygwin tree.
    CD to the directory you just created.
    Now try:

    ./configure --without-server make make install
    That should install enough of the MySQL client to allow you to install DBD::Mysql (I think ...).

    I hope that helps, at least a little.

    Cheers,

    Brent

    -- Yeah, I'm a Delt.