【问题标题】:Does installing Perl DBD-mysql-4.021 need MySQL header on MacOs Lion?在 MacOs Lion 上安装 Perl DBD-mysql-4.021 是否需要 MySQL 标头?
【发布时间】:2012-07-29 03:21:09
【问题描述】:

我尝试在 MacOS Lion 上安装 DBD-mysql-4.021,但是当我这样做时,它似乎遗漏了一些头文件。

MacBook-Pro-de-benoit:DBD-mysql-4.021-XXi0wV vanalder$ sudo make 
llvm-gcc-4.2 -c -I/Library/Perl/5.12/darwin-thread-multi-2level/auto/DBI -I/Applications/MAMP/Library/include -fno-omit-frame-pointer  -g -DDBD_MYSQL_INSERT_ID_IS_GOOD -g  -arch x86_64 -arch i386 -g -pipe -fno-common -DPERL_DARWIN -fno-strict-aliasing -fstack-protector -I/usr/local/include -Os   -DVERSION=\"4.021\" -DXS_VERSION=\"4.021\"  "-I/System/Library/Perl/5.12/darwin-thread-multi-2level/CORE"   dbdimp.c In file included from dbdimp.c:20: 
dbdimp.h:24:49: error: mysql.h: No such file or directory 
dbdimp.h:25:45: error: mysqld_error.h: No such file or directory 
dbdimp.h:27:49: error: errmsg.h: No such file or directory In file included from dbdimp.c:20: dbdimp.h:159: error: expected specifier-qualifier-list before ‘MYSQL’ dbdimp.h:257: error: expected specifier-qualifier-list before ‘MYSQL_RES’ In file included from dbdimp.c:20:
....

我尝试从here 安装 MySQL 的二进制文件。我可以安装,但它不起作用。或者用macports安装(mysql5-devel -> 不能安装),用Perl用MySQL怎么办?


我从这个链接 [http://www.mysql.com/downloads/mysql/][1]http://www.mysql.com/downloads/mysql/ 再次从 DMG 安装了 mysql 但是当我做时我仍然有同样的错误

sudo make

dbdimp.h:24:49: error: mysql.h: No such file or directory
dbdimp.h:25:45: error: mysqld_error.h: No such file or directory
dbdimp.h:27:49: error: errmsg.h: No such file or directory
In file included from dbdimp.c:20:
dbdimp.h:159: error: expected specifier-qualifier-list before ‘MYSQL’
dbdimp.h:257: error: expected specifier-qualifier-list before ‘MYSQL_RES’
In file included from dbdimp.c:20:
....

这是我第一次在安装 CPAN 模块时遇到问题(Xcode 安装和 GCC 编译器 k)

【问题讨论】:

  • 可以从here获取MYSQL

标签: mysql macos perl dbd


【解决方案1】:

是的,您必须安装 MySQL 才能使客户端工作,因为它依赖于 MySQL 客户端代码。我通常使用 MySQL 提供的 DMG 下载,其中包括 MySQL 安装程序、启动脚本安装程序和首选项窗格:

确保为您的系统获得正确的平台。 编辑: 正如 Quentin 所指出的,问题是关于 Lion,它始终是 64 位的。

【讨论】:

  • 它是 Lion,仅在 64 位 Intels AFAIK 上运行。当然不能在 G5 上运行。
  • 问题是我已经在Lion上安装了mysql(一个安装了pkg,一个安装了mamp)。
【解决方案2】:

我自己找到了解决方案,我用的是mysql的MAMP安装目录,但是显然不完整,所以在重新安装mysql后我只是简单地使用了这个选项:

sudo perle Makefile.pl --mysqlconfig=/usr/local/mysql/bin/mysqlconfig

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2011-05-11
    • 2012-02-29
    • 2020-03-12
    • 2019-05-20
    • 2011-06-11
    • 2020-01-04
    • 1970-01-01
    相关资源
    最近更新 更多