Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

[SOLVED] Using Perlbrew with debian Perl packages like libdbd-mysql

by nysus (Priest)
on Dec 13, 2017 at 19:31 UTC ( #1205472=perlquestion: print w/replies, xml ) Need Help??
nysus has asked for the wisdom of the Perl Monks concerning the following question:

I've got perlbrew installed on a development machine running an older version of perl. On my debian box, I used system perl, using the debian package manager, to get mysql installed. I now want to install DBD::mysql so my perlbrew scripts can use it. I can install the Debian libdbd-mysql package and get it installed system wide easily. But, of course, my scripts running on the Perlbrew version of perl know nothing about their existence and so can't use the perl packages installed by libdbd-mysql. And when I try to install DBD::mysql with perlbrew, I get configuration errors.

So what's the most painless way of getting perlbrew to work with DBD::mysql? Is there a way to get it to use the system wide DBD::mysql package that won't break things? Thanks!

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

  • Comment on [SOLVED] Using Perlbrew with debian Perl packages like libdbd-mysql

Replies are listed 'Best First'.
Re: Using Perlbrew with debian Perl packages like libdbd-mysql
by karlgoethebier (Monsignor) on Dec 13, 2017 at 19:49 UTC
    "... I get configuration errors..."

    What errors do you get? See also. Best regards, Karl

    «The Crux of the Biscuit is the Apostrophe»

    perl -MCrypt::CBC -E 'say Crypt::CBC->new(-key=>'kgb',-cipher=>"Blowfish")->decrypt_hex($ENV{KARL});'Help

      cpanm (App::cpanminus) 1.7043 on perl 5.014004 built for x86_64-linux Work directory is /home/steve/.cpanm/work/1513190088.24934 You have make /usr/bin/make You have LWP 6.29 You have /bin/tar: tar (GNU tar) 1.29 Copyright (C) 2015 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gp +l.html>. This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Written by John Gilmore and Jay Fenlason. You have /usr/bin/unzip Searching DBD::mysql () on cpanmetadb ... --> Working on DBD::mysql Fetching http://www.cpan.org/authors/id/M/MI/MICHIELB/DBD-mysql-4.043. +tar.gz -> OK Unpacking DBD-mysql-4.043.tar.gz Entering DBD-mysql-4.043 Checking configure dependencies from META.json Checking if you have Data::Dumper 0 ... Yes (2.130_02) Checking if you have DBI 1.609 ... Yes (1.637) Configuring DBD-mysql-4.043 Running Makefile.PL Can't exec "mysql_config": No such file or directory at Makefile.PL li +ne 88. Cannot find the file 'mysql_config'! Your execution PATH doesn't seem not contain the path to mysql_config. Resorting to guessed values! PLEASE NOTE: For 'make test' to run properly, you must ensure that the database user 'steve' can connect to your MySQL server and has the proper privileges that these tests require such as 'drop table', 'create table', 'drop procedure', 'create procedure' as well as others. mysql> grant all privileges on test.* to 'steve'@'localhost' identifie +d by 's3kr1t'; You can also optionally set the user to run 'make test' with: perl Makefile.PL --testuser=username Can't exec "mysql_config": No such file or directory at Makefile.PL li +ne 561. Failed to determine directory of mysql.h. Use perl Makefile.PL --cflags=-I<dir> to set this directory. For details see DBD::mysql::INSTALL, section "C Compiler flags" or type perl Makefile.PL --help Can't find mysql_config. Use --mysql_config option to specify where my +sql_config is located -> N/A -> FAIL Configure failed for DBD-mysql-4.043. See /home/steve/.cpanm/w +ork/1513190088.24934/build.log for details.

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

        Can't exec "mysql_config": No such file or directory at Makefile.PL line 88.
        apt-file can be a great help for such things. I often get errors about missing .h files and don't know which package they are in, but usually I find them with apt-file.
        % apt-file search mysql_config
        It also takes regular expressions.
Re: Using Perlbrew with debian Perl packages like libdbd-mysql
by nysus (Priest) on Dec 13, 2017 at 22:46 UTC

    Solved, with some more diligent googling:

    1) I found this: http://adam.sardar.me.uk/?p=693

    2) Basically it says to: Install the package ‘libmysqlclient-dev’ through aptitude.

    3) However, that package name is no longer around.

    4) I got the new package name and did: sudo apt-get install default-libmysqlclient-dev

    5) cpanm DBD::mysql now works

    Unfortunately, I have no idea why or how it works.

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

      "Unfortunately, I have no idea why or how it works"

      If you'd taken more than a glance at the documentation I linked to:

      "Also you'll need to get the MySQL client and development headers on your system. The easiest is to get these from your package manager...."

        Yeah, well, without being told explicitly which package they are in, I have no clue how or where to get them. The debian packaging system is a large black box to me. I have only vague notions of how it works despite doing some reading on it. I barely know what a header is from the C book I picked up 20 blue moons ago. It kind of makes things a lot harder to figure out. And then I'm left wondering why I need a damn "client" when I'm trying to set up a "server." And I have no idea what "development" headers are. It's confusing as hell.

        RTFM is all well and good. But when you start mixing and matching technologies and run into edge cases, the manual has limitations unless you have an advanced understanding of what's going on under the hood, which I admittedly do not. Yeah, sure, I could spend a day or two going through in great deal to learn more about the intricacies of the debian packaging system and how it all works, but right now I'm trying to focus on more immediate concerns and learn another technology I'm trying to learn.

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

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1205472]
Approved by davies
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (7)
As of 2018-07-17 23:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    It has been suggested to rename Perl 6 in order to boost its marketing potential. Which name would you prefer?















    Results (379 votes). Check out past polls.

    Notices?