在Windows中安装perl DBI-mysql的问题 [英] issues installing perl DBI-mysql in windows

查看:313
本文介绍了在Windows中安装perl DBI-mysql的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在我的Windows 7 64计算机上下载并安装了 ActivePerl 。一切顺利,并将 perl 解释器加载到我的 Eclipse 平台中。
然而,当我尝试访问一个 localhost 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 = "<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";

那么我得到以下错误:

     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.

另外,当我尝试安装DBD-Mysql时,我得到:

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

我安装了 DBI 数据表,但我不能安装 DBD-Mysql 。有什么想法吗?
感谢

I have installed DBI, Data-Table, but I can't install DBD-Mysql. Any thoughts? Thanks

推荐答案

请参阅 DBD-mysql ppm信息页构建日志文件

ActiveState尝试应用一些本地修补程序建设,但它失败。联系他们有这个固定。还原到5.14同时有一个PPM包存在,或尝试在您自己的系统上手动构建DBD-mysql如果你知道如何。

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.

这篇关于在Windows中安装perl DBI-mysql的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆