A
alx__21
Hello. Using the following test code:
#!/usr/bin/perl
use DBI;
$db_handle = DBI-
//I've edited out some data there obviously
open(FILEHANDLE, ">", "C:\\test.txt") || die('cannot open file: ' .
$!);
$sql = "SELECT * FROM hhdb2.handhelds";
$statement = $db_handle->prepare($sql)
or die "Couldn't prepare query '$sql': $DBI::errstr\n";
$statement->execute()
or die "Couldn't execute query '$sql': $DBI::errstr\n";
while ($row_ref = $statement->fetchrow_hashref())
{
print FILEHANDLE "$row_ref->{id}\n";
}
close(FILEHANDLE);
$db_handle->dis
connect();
.... I get the following error:
install_driver(mysql) failed: Can't locate DBD/mysql.pm in @INC (@INC
contains:
C:/Perl/site/lib C:/Perl/lib .) 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, ODBC, Proxy, SQLite,
Sponge.
at Z:\changelist\dbtest2.pl line 5
I'm sure that DBI is installed (ppm says so) and I've read repeatedly
that this should be able to use a mysql database. What has gone
wrong?
I would appreciate any help.
#!/usr/bin/perl
use DBI;
$db_handle = DBI-
or die "Couldn't connect to database: $DBI::errstr\n";connect("dbi:mysql:database=mysql;host=x.x.x.x;user=x;password=x")
//I've edited out some data there obviously
open(FILEHANDLE, ">", "C:\\test.txt") || die('cannot open file: ' .
$!);
$sql = "SELECT * FROM hhdb2.handhelds";
$statement = $db_handle->prepare($sql)
or die "Couldn't prepare query '$sql': $DBI::errstr\n";
$statement->execute()
or die "Couldn't execute query '$sql': $DBI::errstr\n";
while ($row_ref = $statement->fetchrow_hashref())
{
print FILEHANDLE "$row_ref->{id}\n";
}
close(FILEHANDLE);
$db_handle->dis
connect();
.... I get the following error:
install_driver(mysql) failed: Can't locate DBD/mysql.pm in @INC (@INC
contains:
C:/Perl/site/lib C:/Perl/lib .) 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, ODBC, Proxy, SQLite,
Sponge.
at Z:\changelist\dbtest2.pl line 5
I'm sure that DBI is installed (ppm says so) and I've read repeatedly
that this should be able to use a mysql database. What has gone
wrong?
I would appreciate any help.