problem installing DBD/mysql.pm

problem installing DBD/mysql.pm

am 07.11.2007 10:11:46 von 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

Re: problem installing DBD/mysql.pm

am 07.11.2007 12:33:31 von Sherm Pendley

mmccaws2 writes:

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

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.

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

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

> 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?

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--

--
WV News, Blogging, and Discussion: http://wv-www.com
Cocoa programming in Perl: http://camelbones.sourceforge.net

Re: problem installing DBD/mysql.pm

am 07.11.2007 16:47:32 von mmccaws2

On Nov 7, 3:33 am, Sherman Pendley wrote:
> mmccaws2 writes:
> > now the install seems to have installed it in my .cpan directory
>
> 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.
>
> > /home/mmcca/.cpan/Bundle/DBD/mysql.pm
>
> That's not even a module - it's a bundle file. Little wonder Perl couldn't
> load it as a DBD driver.
>
> > 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?
>
> 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--
>
> --
> WV News, Blogging, and Discussion:http://wv-www.com
> Cocoa programming in Perl:http://camelbones.sourceforge.net

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

Re: problem installing DBD/mysql.pm

am 07.11.2007 18:04:40 von Ben Morrow

Quoth mmccaws2 :
>
> 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