简体   繁体   English

为什么我不能安装DBD :: mysql以便可以与Maatkit一起使用?

[英]Why can't I install DBD::mysql so I can use it with Maatkit?

I'm trying to install Maatkit following the maatkit instructions . 我正在尝试按照maatkit的说明安装Maatkit I can't get past having to install DBD::mysql. 我无法摆脱必须安装DBD :: mysql的麻烦。 "Warning: prerequisite DBD::mysql 1 not found." “警告:未找到先决条件DBD :: mysql1。” When I try to install DBD::mysql from cpan, I get very helpful "make had returned bad status, install seems impossible". 当我尝试从cpan安装DBD :: mysql时,我得到了非常有帮助的“ make返回错误状态,似乎无法安装”。

Perl is "v5.8.8 built for darwin-thread-multi-2level", the one that came with OS X. I also tried building from source with same result. Perl是“为darwin-thread-multi-2level构建的v5.8.8”,它是OS X附带的。我也尝试从源代码进行构建 ,但结果相同。

We need more of the error message. 我们需要更多错误消息。 Most likely, you are missing the MySQL client development files. 最有可能的是,您缺少MySQL客户端开发文件。 I don't know how to install these on OSX. 我不知道如何在OSX上安装它们。 Also see this older post on OSX 10.5.2 , in which some other failures with the mysql client libraries are found. 另请参阅OSX 10.5.2上的较早的文章 ,其中发现了mysql客户端库的其他一些故障。

Possibly post this question with more parts of your error message at perlmonks.org , if stackoverflow doesn't allow for convenient pasting of your make session or rather the last 20 or 10 lines of it. 如果stackoverflow不允许方便地粘贴您的make会话或会话的最后20或10行,则可以在perlmonks.org上将错误消息的更多内容发布到该问题。

Some more Googling with site:perlmonks.org also finds this post which has some more details on things to watch out for when installing DBD::MySQL. site:perlmonks.org搜索更多内容,还会发现该帖子 ,其中包含有关在安装DBD :: MySQL时要注意的事项的更多详细信息。 Depending on how comfortable you feel with the installation, you might want to manually run the tests, supplying a test database and test user or even skip testing the module. 根据您对安装的感觉,您可能需要手动运行测试,提供测试数据库并测试用户,甚至跳过测试模块。

After a bit more googling, this worked for me: 经过更多的谷歌搜索后,这为我工作:

sudo ln -s /usr/local/mysql/lib /usr/local/mysql/lib/mysql
sudo ln -s /usr/local/mysql/include /usr/local/mysql/include/mysql
sudo perl -MCPAN -e 'install Bundle::DBD::mysql'

press enter a bunch of times, then in your maatkit folder: 按下Enter键,然后在您的maatkit文件夹中:

perl Makefile.PL
sudo make install

and you'll find the mk-* programs in /usr/local/bin/ 然后您将在/ usr / local / bin /下找到mk- *程序

You will want to install MySQL first. 您将要首先安装MySQL I usually use the binary packages they provide for OS X. The packages do include the headers and MySQL client libraries which DBD::MySQL requires. 我通常使用它们为OS X提供的二进制软件包 。这些软件包确实包含DBD :: MySQL所需的标头和MySQL客户端库。 Once the MySQL package is installed, DBD::MySQL should install without issue. 安装MySQL程序包后,DBD :: MySQL应该安装没有问题。

Here is my output: 这是我的输出:

$ perl Makefile.PL
Checking if your kit is complete...
Looks good
Warning: prerequisite DBD::mysql 1 not found.
Writing Makefile for maatkit

$ mysql --version
mysql  Ver 14.12 Distrib 5.0.51b, for apple-darwin9.0.0b5 (i686) using readline 5.0

I notice that there are in effect DBD::MySQL packages in the fink repositories. 我注意到芬克存储库中实际上有DBD :: MySQL软件包。 For example: 例如:

ayaz@ayazs-macbook$ fink list | grep -i 'dbd-mysql'
    dbd-mysql-pm586 3.0008-10   Perl5 Database Interface to MySQL
    dbd-mysql-pm588 3.0008-10   Perl5 Database Interface to MySQL

Perhaps installing through fink one of those packages may help alleviate your troubles. 也许通过芬克(fink)安装这些软件包之一可能有助于减轻您的麻烦。

Also, and I cannot be certain of this, you may want to install for MySQL-5.x (if you have that version installed) the mysql15-dev and mysql15-shlibs packages. 另外,我不确定,您可能想要为MySQL-5.x(如果安装了该版本)安装mysql15-dev和mysql15-shlibs软件包。 I installed those through fink thus: 我通过芬克安装这些:

$ sudo fink --use-binary-dist install mysql15-dev

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 DBD-mysql 安装,但仍然错误“install_driver(mysql) failed: Can't locate DBD/mysql.pm in @INC” - DBD-mysql installed ,but still error "install_driver(mysql) failed: Can't locate DBD/mysql.pm in @INC" 如果未安装postgres,如何安装DBD :: Pg? - How can I install DBD::Pg if postgres is not installed? 即使cpan告诉我已安装DBD :: mysql,为什么我的Perl脚本也找不到DBD / mysql.pm? - Why can't my Perl script locate DBD/mysql.pm even though cpan tells me DBD::mysql is installed? 我可以更改DBD :: mysql使用的数据包大小吗? - Can I change the packet size DBD::mysql uses? 如何检查Perl模块(DBD :: mysql)是否正确安装? - How can I check if a Perl module (DBD::mysql) is properly installed? install_driver(ODBC)失败:无法为模块DBD :: ODBC:libodbc.so.1加载'/usr/local/lib64/perl5/auto/DBD/ODBC/ODBC.so' - install_driver(ODBC) failed: Can't load '/usr/local/lib64/perl5/auto/DBD/ODBC/ODBC.so' for module DBD::ODBC: libodbc.so.1 为什么不能用DBD :: DB2断开数据库句柄? - Why can't I disconnect my database handles with DBD::DB2? 如何告诉DBD :: CSV使用逗号作为小数分隔符? - How can I tell DBD::CSV to use a comma as the decimal seperator? 如何修复 install_driver(mysql) 失败:在 Windows 中找不到模块 DBD::mysql 的可加载对象 - How to fix install_driver(mysql) failed: Can't locate loadable object for module DBD::mysql in windows 试图安装Perl-Mysql DBD,无法找到mysql_config - Trying to install Perl-Mysql DBD, mysql_config can't be found
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM