I have downloaded and installed ActivePerl on my Windows 7-64 machine. Everything went smooth, and also loaded the perl interpreter into my Eclipse platform.
However, when I try to access a localhost MySQL database, I got the following error:
$database = "<database>";
$host = "localhost";
$user = "<user>";
$password = "<password>";
#connect to MySQL database
my $db = DBI->connect(
"DBI:mysql:database=$db:host=$host",
$user,
$password
) or die "Can't Connect to database: $DBI::errstr\n";
then I get the following error:
install_driver(mysql) failed: Can't locate DBD/mysql.pm in @INC (@INC contains: C:/Users/souzamor/workspace/.metadata/.plugins/org.epic.debug C:/Users/souzamor/workspace/Parser C:/Perl64/site/lib C:/Perl64/lib .) at (eval 3) 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:/Users/souzamor/workspace/Parser/Parser.pl line 14.
Also, when I try to install DBD-Mysql I get:
C:\Perl64\bin>ppm install DBD-Mysql
ppm install failed: Can't find any package that provides DBD-Mysql
I have installed DBI, Data-Table, but I can’t install DBD-Mysql. Any thoughts?
Thanks
See DBD-mysql ppm info page, build log file.
ActiveState tries to apply some local patches before building, but it fails. Contact them to have this fixed. Revert to 5.14 meanwhile for which a PPM package exists, or try to build DBD-mysql manually on your own system if you know how.