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

I want to install the mysql driver for DBI on my local machine that does not run mysql. When I try to install there is an error saying that mysql config file can't be found because I don't have mysql installed on my machine. However, there is a configure --without-server option. So I tried cpanm install DBD::mysql --configure-arg="--without-server" and cpanm install DBD::mysql --configure-args="configure --without-server" but both give me an Unknown option: without-server error when I try to compile.

Thanks.

$PM = "Perl Monk's";
$MCF = "Most Clueless Friar Abbot Bishop Pontiff Deacon Curate";
$nysus = $PM . ' ' . $MCF;
Click here if you love Perl Monks

Replies are listed 'Best First'.
Re: Passing compilation options through to cpanm
by 1nickt (Canon) on Mar 30, 2017 at 22:31 UTC

    I'm pretty sure that's talking about if you build the mysql libraries by hand.

    From the documentation for DBD::mysql:

    You may also create client files by compiling from the MySQL source di +stribution and using configure --without-server

    Edit: But why worry? You can install MySQL anywhere and it's handy to have a local installation. You don;t have to run the server if you don't want to ....

    Hope this helps!


    The way forward always starts with a minimal test.
Re: Passing compilation options through to cpanm
by marto (Cardinal) on Mar 31, 2017 at 09:21 UTC

    Update: Meh 1nickt beat me to it :P

    cpanm has --with-feature and --interactive options however, you seem to be talking about something mysql related, and not perl DBD::mysql::INSTALL, PREREQUISITES states:

    "MySQL

    You need not install the actual MySQL database server, the client files and the development files are sufficient. For example, Fedora Linux distribution comes with RPM files (using YUM) mysql and mysql-server (use "yum search" to find exact package names). These are sufficient, if the MySQL server is located on a foreign machine. You may also create client files by compiling from the MySQL source distribution and using

    configure --without-server

    If you are using Windows and need to compile from sources (which is only the case if you are not using ActivePerl or Strawberry Perl), then you must ensure that the header and library files are installed. This may require choosing a "Custom installation" and selecting the appropriate option when running the MySQL setup program."

    The perl module DBD::mysql has no configure or --without-server option.

Re: Passing compilation options through to cpanm
by Corion (Patriarch) on Mar 31, 2017 at 06:24 UTC

    A "good" Makefile.PL accepts its configuration parameters not only from the command line but also throught the environment, just to make it possible to easily pass parameters across multiple process invocations. Look in the Makefile.PL of DBD::mysql to see whether it does that.

    You need to have the MySQL client libraries and headers installed anyway if you're installing DBD::mysql.

Re: Passing compilation options through to cpanm
by LanX (Saint) on Mar 31, 2017 at 02:10 UTC
    Isn't cpan-minus meant do be reduced to the essentials?

    If I wanted to have more control, I'd use the full blown cpan client.

    Cheers Rolf
    (addicted to the Perl Programming Language and ☆☆☆☆ :)
    Je suis Charlie!