
dpuk44
Novice
Jul 28, 2011, 4:00 AM
Post #1 of 3
(2242 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
|