Can't locate DBI.pm in @INC

my os details as follow

bash-3.2$ cat /etc/redhat-release 
Red Hat Enterprise Linux Server release 5.8 (Tikanga)

I run the following and encounter the following error

bash-3.2$  mysqlhotcopy -?
Can't locate DBI.pm in @INC (@INC contains: /usr/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/site_perl/5.8.8 /usr/lib/perl5/site_perl /usr/lib64/perl5/vendor_perl/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.8 /usr/lib/perl5/vendor_perl /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/5.8.8 .) at /usr/bin/mysqlhotcopy line 25.
BEGIN failed--compilation aborted at /usr/bin/mysqlhotcopy line 25.

note although this seems to be a mysql question but problem tells me that there's some installation problems at the os level.

would appreciate any suggested solutions.

even the answer found in perl - Error "Can't locate version.pm in @INC" when I call my DBI module - Stack Overflow

could not resolve my issue

thanks a alot!

your error message says that perl cannot find the DBI.pm module ... confirm that you have it installed and install it if not there ... if already installed, confirm that the perl version you are using with your script can actually see it ... you may have to get the correct install version from red hat's repositories -- if they exist -- though cpan.org should be the primary source of any installed modules ...

@INC is an array of directories - exactly like the PATH variable. Use the UNIX find command to locate the DBI.pm files. add the driectory to @INC this way:

the PERLLIB environment variable
        $ export PERLLIB=/path/to/my/dir
        $ perl program.pl
the PERL5LIB environment variable
        $ export PERL5LIB=/path/to/my/dir
        $ perl program.pl
the perl -Idir command line flag
        $ perl -I/path/to/my/dir program.pl
the lib pragma:
        use lib "$ENV{HOME}/myown_perllib";
the local::lib module:
        use local::lib;

        use local::lib "~/myown_perllib";

Choose a method.

it's already installed

-bash-3.2$ perl -v

This is perl, v5.8.8 built for x86_64-linux-thread-multi

Copyright 1987-2006, Larry Wall

Perl may be copied only under the terms of either the Artistic License or the
GNU General Public License, which may be found in the Perl 5 source kit.

Complete documentation for Perl, including FAQ lists, should be found on
this system using "man perl" or "perldoc perl".  If you have access to the
Internet, point your browser at http://www.perl.org/, the Perl Home Page.


btw how do I find DBI.pm, what's the best find command syntax to find it.

I have problems finding it.

find /usr/lib/ -iname "DBI.pm"

perl would not have worked if it was not installed ... your error is about the missing DBI.pm module that perl cannot find under the /usr/lib*/perl5 directories ...

try ...

find /usr -type f  -name "*[dD][bB][iI]*" -print

one you have verified that you actually have the module installed and your script still fails, you might want to post your script so people can see where the problem is happening ...

[root@11gr2-secondary ~]# find /usr -type f  -name "*[dD][bB][iI]*" -print
/usr/share/man/man3/FindBin.3pm.gz
/usr/share/fonts/default/ghostscript/hrpldbi.gsf
/usr/share/mysql-test/include/have_dbi_dbd-mysql.inc
/usr/share/mysql-test/std_data/checkDBI_DBD-mysql.pl
/usr/lib/perl5/5.8.8/FindBin.pm

what does the result mean, I don't see any DBI modules?

thanks a lot!

later I installed a couple of things, now I've come to this error

[root@11gr2-secondary ~]# mysqlhotcopy -u root -p test1 /u03/mysql/mysqlhotcopy/
install_driver(mysql) failed: Can't locate DBD/mysql.pm in @INC (@INC contains: /usr/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/site_perl/5.8.8 /usr/lib/perl5/site_perl /usr/lib64/perl5/vendor_perl/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.8 /usr/lib/perl5/vendor_perl /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/5.8.8 .) at (eval 7) line 3.
Perhaps the DBD::mysql perl module hasn't been fully installed,
or perhaps the capitalisation of 'mysql' isn't right.
Available drivers: DBM, ExampleP, File, Gofer, Multiplex, Proxy, Sponge.
 at /usr/bin/mysqlhotcopy line 197


anyone has solutions to the above?

thanks a lot!

---------- Post updated 07-16-13 at 12:05 AM ---------- Previous update was 07-15-13 at 10:55 PM ----------

I realize that I was not able to install install Bundle::DBD::mysql properly

I encountered the following error

Running make test
PERL_DL_NONLAZY=1 /usr/bin/perl "-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
t/00base....................NOK 2                                            
#   Failed test 'use DBD::mysql;'
#   at t/00base.t line 21.
#     Tried to use 'DBD::mysql'.
#     Error:  Can't load '/root/.cpan/build/DBD-mysql-4.023/blib/arch/auto/DBD/mysql/mysql.so' for module DBD::mysql: /root/.cpan/build/DBD-mysql-4.023/blib/arch/auto/DBD/mysql/mysql.so: undefined symbol: mysql_get_server_version at /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/DynaLoader.pm line 230.
#  at (eval 7) line 2
# Compilation failed in require at (eval 7) line 2.
# BEGIN failed--compilation aborted at (eval 7) line 2.
FAILED--Further testing stopped: Unable to load DBD::mysql
make: *** [test_dynamic] Error 9

any one know how to resolve the above? thanks a lot!