Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Problems accessing a mysql DB using DBI

2 views
Skip to first unread message

MAntunes

unread,
Oct 17, 2000, 3:00:00 AM10/17/00
to
Hi.

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 )

Dick Latshaw

unread,
Oct 17, 2000, 3:00:00 AM10/17/00
to
In article <9717819...@cachalote.ip.pt>,

"MAntunes" <mant...@sonae.pt> wrote:
> 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

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.

mac...@my-deja.com

unread,
Oct 17, 2000, 3:00:00 AM10/17/00
to

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

MAntunes

unread,
Oct 17, 2000, 3:00:00 AM10/17/00
to
>
> 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

Malte Ubl

unread,
Oct 17, 2000, 3:00:00 AM10/17/00
to
mac...@my-deja.com schrieb:

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

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

ubl.vcf

MC

unread,
Oct 19, 2000, 3:00:00 AM10/19/00
to
you also need mySQL server installed if you are accessing a local database,
which it appears is the case. I had the same problem recently.

www.mysql.com

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:

0 new messages