in reply to Can't locate DBD/Mysql.pm in @INC

Hey…
Toolic and Davido: I’ve included the entire test below (its short :D) I have tried caps and non-caps and both, I think DBD::mysql is non-caps on the “M” whereas Mysql.pm is caps. I’ve tried (I think) all iterations…but I’ll try them all again.

My other scripts (the ones written against Perl 5.8 use the Mysql.pm module – so maybe the focus should be on trying to get it to load properly through MCPAN. I do want to have the other scripts working with Perl 5.14 (see below).

@Onelesd: I DO in fact have two versions installed in the same system. One in /usr/bin and one in /usr/local/bin. The perl 5.14 install went there by default. I wasn;t sure if this was the issue since …

A) The OTHER MCPAN installs went in fine (except for Mysql) and B) The paths in the @INC statement (error message) all seem to be pointing to the 5.14 paths (although I could be wrong).

----> I updated Perl by doing a fresh config and install from the tar.gz. Is there a way to actuall “update” 5.8?

Thanks for the help!!

SNIPPET #!/usr/local/bin/perl -l

use DBD::Mysql;
use Date::Manip;
use Date::Manip::Date;

# CONFIG VARIABLES
$database = "tapestorage";
$host = "localhost";
$tablename = "tapes";
$user = "root";
$pw = "";

$connect = Mysql->connect($host, $database, $user, $pw);
$connect->selectdb($database);
$mysqlquery = "SELECT * FROM tapes WHERE expdate > '$startdate' AND expdate <= '$enddate';";
$execute = $connect->query($mysqlquery);
while (@results = $execute->fetchrow()) {
print fh "$results[0]|$results1|$results2";
}

$data = qx{rsh
master /usr/openv/netbackup/bin/admincmd/bpmedialist -m SJ9063 -mlist -l};
@bpmedialist = split(/ /,$data);

$test=ParseDateString("epoch $bpmedialist6");
print "Test = $test";
END SNIPPET

Replies are listed 'Best First'.
Re^2: Can't locate DBD/Mysql.pm in @INC
by Anonymous Monk on Jun 14, 2011 at 04:23 UTC
    • It is DBD::mysql, there is no module named DBD::Mysql
    • If DBD::mysql doesn't work, you need to install DBD::mysql
    • Every time you create a post here, you get a reminder to use code tags, so follow the advice, and put your code in between code tags, its where code (and data) goes :)
      Hey...thanks for the help. I have successfully installed DBD::mysql...but all my scripts (the ones using the existing perl 5.8) use the Mysql pm (not associated with DBD)

      I was hoping to avoid having to change them all to use the DBD::mysql if I could avoid it :D
        I was hoping to avoid having to change them all to use the DBD::mysql if I could avoid it :D

        You don't have to change, but you do have to use Mysql; because use DBD::mysql; doesn't load Mysql

Re^2: Can't locate DBD/Mysql.pm in @INC
by Anonymous Monk on Jun 14, 2011 at 11:12 UTC
      <from BurningKrome> Ya...my scripts (perl 5.8) were all written using the Mysql.pm. When I installed 5.14...I was able to install DBD::mysql (more or less as a est) but it chokes on installing Mysql (the pm I was originally using).

      The install finds the pm, but chokes on the make.

      I've been using...
      perl -MCPAN -e shell
      and then...
      install Mysql