problem installing DBD/mysql.pm


M

mmccaws2

I'm getting closer but don't know where I going wrong. On HPUX system
and had to manually install DBI and DBD-mysql modules. the error
message says
error message begin
DBD::mysql initialisation failed: Can't locate object method "driver"
via package "DBD::mysql" at /opt/perl_32/lib/5.8.8/IA64.ARCHREV_0-
thread-multi/DBI.pm line 782.

Perhaps the capitalisation of DBD 'mysql' isn't right. at ./conntst.pl
line 6
error message end


now the install seems to have installed it in my .cpan directory

/home/mmcca/.cpan/Bundle/DBD/mysql.pm

so in the test script I put a lib statement. Am I using lib correctly
or do I need a different method to have mysql.pm visible to the DBI
module? Below the code is the original error message.

#!/usr/bin/perl
use strict;
use lib '/home/mmcca/.cpan/Bundle';
use DBI;

my $dbh = DBI->connect('DBI:mysql:smartcard:localhost', 'root',
'Welcome1',
{RaiseError => 1});
if ($dbh) {
print "Successfully connected to the database\n";
}
$dbh->disconnect;

orignal error message
$ ./conntst.pl
install_driver(mysql) failed: Can't locate DBD/mysql.pm in @INC (@INC
contains: /home/mccannm/.cpan/Bundle/DBD /opt/perl_32/lib/5.8.8/
IA64.ARCHREV_0-thread-multi /opt/perl_32/lib/5.8.8 /opt/perl_32/lib/
site_perl/5.8.8/IA64.ARCHREV_0-thread-multi /opt/perl_32/lib/site_perl/
5.8.8 /opt/perl_32/lib/site_perl /opt/perl_32/lib/vendor_perl/5.8.8/
IA64.ARCHREV_0-thread-multi /opt/perl_32/lib/vendor_perl/5.8.8 /opt/
perl_32/lib/vendor_perl .) at (eval 4) 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, Proxy, SQLite, Sponge,
mysqlPP.
at ./conntst.pl line 6
 
Ad

Advertisements

M

mmccaws2

Modules are never installed there. What you are looking at is a temporary
file created during the process of unzipping and building the module with
the CPAN shell.


That's not even a module - it's a bundle file. Little wonder Perl couldn't
load it as a DBD driver.


When it's installed correctly, you won't need a lib statement.

Reverse course and back up a bit - you need to figure out why the module
is not installed correctly. Pay close attention to what gets printed when
you run the install - it will tell you about any errors in the process.

sherm--

So if I run perl Makefile.PL, make, make test, make install this
process removes the previous, or just over writes the previous. Or is
there an uninstall process that needs to be run.

Mike
 
Ad

Advertisements

B

Ben Morrow

Quoth mmccaws2 said:
So if I run perl Makefile.PL, make, make test, make install this
process removes the previous, or just over writes the previous. Or is
there an uninstall process that needs to be run.

Overwrites. If you run make install UNINST=1 it will attempt to remove
conflicting modules in other parts of the Perl module tree, but this is
not the same as uninstalling the whole distribution. Perl currently has
very little support for uninstalling modules, which is one reason why
it's a good idea to use your OS's package manager instead, if you can
(unless you're lucky enough to be using BSD, when BSDPAN will take care
of it for you... :) ).

Ben
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top