CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Intermediate:
DBD ERROR HEEEEEEELP!!!

 



dpuk44
Novice

Jul 28, 2011, 4:00 AM

Post #1 of 3 (628 views)
DBD ERROR HEEEEEEELP!!! Can't Post

Hi all,

Pretty new to Perl and MySQL, Installed ActiveState with PPM GUI. I installed MySQL Server 5.1 and created a simple database called perltest. Now I created my .pl script which looks like the following:

#!C:/Perl/bin

use DBI;
$dbh = DBI->connect('dbi:mysql:perltest','root','root')
or die "Connection Error: $DBI::errstr\n";
$sql = "select * from samples";
$sth = $dbh->prepare($sql);
$sth->execute
or die "SQL Error: $DBI::errstr\n";
while (@row = $sth->fetchrow_array) {
print "@row\n";
}

When I run test.pl (script above) I get an error message of the following:

install_driver(mysql) failed: Can't locate DBD/mysql.pm in @INC (@INC contains:C:/Perl/site/lib C:/Perl/lib .) at (eval 5) line 3. Perhaps the DBD::mysql perl module hasn't been fully installed, or perhaps the capitalisation of 'mysql' isn't right. Available drivers: CSV, DBM, ExampleP, File, Gofer, ODBC, Oracle, Pg, Proxy, SQLite, Sponge. at C:\Documents and Settings\Dale\test.pl line 4.

What does this mean as I am truely stuck :(

Dale


FishMonger
Veteran / Moderator

Jul 28, 2011, 6:18 AM

Post #2 of 3 (620 views)
Re: [dpuk44] DBD ERROR HEEEEEEELP!!! [In reply to] Can't Post

It's telling you that you need to install the DBD::mysql driver module to be able to connect to your database.

Run this command from the command line.

Quote
ppm install DBD::mysql



dpuk44
Novice

Jul 28, 2011, 6:21 AM

Post #3 of 3 (617 views)
Re: [FishMonger] DBD ERROR HEEEEEEELP!!! [In reply to] Can't Post

thankyou thankyou thankyou so much :)

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives