I'm a begginer in Perl programming.
At the moment, I'm trying to access a mysql database using the DBI api, and
I got an error:
install_driver(mysql) failed: Can't locate loadable object for module
DBD::mysql in @INC (@INC contains: /usr/lib/perl5/5.00503/i386-linux
/usr/lib/perl5/5.00503 /usr/lib/perl5/site_perl/5.005/i386-linux
/usr/lib/perl5/site_perl/5.005 .) at (eval 1) line 3
Perhaps a module that DBD::mysql requires hasn't been fully installed
at ./teste4.pl line 7
My program is simply:#!/usr/bin/perl -w
use DBI;
#$dbh = DBI->connect( "DBI:mysql:test" , 'root' , 'teste' );# or die "erro -
$DBI::errstr";
$driver = "mysql";
$dsn = "DBI:$driver:mysql";
$dbh = DBI->connect($dsn, 'root', 'test' );
I already looked for this on Perl documentation and I didn't find a thing
!...
The installation process runs OK and the database is up and running...
Can someone help me on this issue ?
Thanks in advance.
Mário
( mant...@novis.pt )
Try the following to check for available drivers:
use DBI;
my @drivers = DBI->available_drivers;
print join "\n",@drivers;
If mysql is not listed, then the driver is not properly installed.
--
Regards,
Dick
Sent via Deja.com http://www.deja.com/
Before you buy.
so my script crushes with the same error and it happens right after
use DBI;
so i can't check whether mySQL module is poperly installed.
Many thanks for the reply !
In fact, running your script, the MySQL is not listed. But I installed the
rpm's ( DBI, MySQL e MySQL-Dbi-perl ... ) and apparently, everything is OK.
Is there some workaround here ?!
Thanks in advance !
Mário
I once had the same problem. You probably made a mistake when you
installed DBI. Just try again. It worked for me on the second try.
malte
MC
MAntunes wrote:
>
> >
> > If mysql is not listed, then the driver is not properly installed.
> > --
> > Regards,
> > Dick
> >
> >
> > Sent via Deja.com http://www.deja.com/
> > Before you buy.
> --------------------------------
>
> Many thanks for the reply !
>
> In fact, running your script, the MySQL is not listed. But I installed the
> rpm's ( DBI, MySQL e MySQL-Dbi-perl ... ) and apparently, everything is OK.
> Is there some workaround here ?!
>
> Thanks in advance !
>
> Mário
--
---------------------------------------------------------------------
I haven't lost my mind!!! It's backed up on disk.
"The world wont end with a bang, or even a whimper, but with an error
message." -- format C: