http://qs321.pair.com?node_id=1134413

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

Hi there

I may be showing my ignorance a little here and this may not be the best place to ask, given that it's also a Linux question, but I am practising setting up a CentOS server to run a Catalyst app on and am trying to keep the Perl installations separate (as specified in Perlbrew issues. Suggest a way out.).

I've been doing okay with it, but am having issues installing DBD::mysql because you can't (as far as I can tell) do it via CPAN. The documentation says to:

Use the following command to install DBD::mysql:

yum install "perl(DBD::mysql)"

However, this command installs the module for the system Perl and not the separate installation I plan on using.

Does anyone know of a way to modify the above command to install DBD::mysql for the non-system Perl please?

I'm very much a novice to Linux, just running CentOS in VirtualBox to practice.

Thank you in advance

Chris

Replies are listed 'Best First'.
Re: Installing DBD::mysql for non-system Perl (CentOS)
by karlgoethebier (Abbot) on Jul 12, 2015 at 18:50 UTC

    As far as i remember you should have installed mySQL and mysql_config should be in your PATH before you build the module. Should work imho with perlbrew and cpanm.

    Update: Links added.

    Regards, Karl

    «The Crux of the Biscuit is the Apostrophe»

      Thank you for that - turns out I needed the dev libraries installed, which I didn't have yet. All sorted, thanks!
Re: Installing DBD::mysql for non-system Perl (CentOS)
by hurricup (Pilgrim) on Jul 13, 2015 at 07:24 UTC

    Can share my own experience working with perlbrew on CentOS 6.6

    CentOS yum repository has precompiled modules, so you can't install anything for anything, like in FreeBSD for example. Only specific DBD::mysql for system perl and system mysql.

    I couldn't make cpan utility to install modules for perlbrew installations. The only working way I found is using perl -MCPAN -e shell.

    From there you may compile and install DBD::mysql, but you need to have mysql-libs installed.

    Here is kinda working script (don't use on production server, only safe test environment):

    # if you've want to use mysql5.5 you need to updgrade mysql and mysqll +ibs: yum install mysql.`uname -i` yum-plugin-replace --assumeyes yum replace mysql-libs --replace-with mysql55-libs --assumeyes # switch to specific perl perlbrew use perl-5.18.4 # start interactive CPAN shell perl -MCPAN -e shell # type in console: install DBD::mysql
    Should work fine

Re: Installing DBD::mysql for non-system Perl (CentOS)
by iguanodon (Priest) on Jul 14, 2015 at 02:13 UTC