perl dbi mysql windows,在Windows中安装perl DBI-mysql的问题

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 = "";

$host = "localhost";

$user = "";

$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

解决方案

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.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值