2012-07-31 80 views
1

我嘗試在MacOS Lion上安裝DBD-mysql-4.021,但是看起來當我這樣做時,它錯過了一些頭文件。在MacOs Lion上安裝Perl DBD-mysql-4.021是否需要MySQL頭文件?

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 - >無法安裝),我應該如何使用MySQL和Perl?


我再次mysql安裝從DMG從這個鏈接[http://www.mysql.com/downloads/mysql/][1]http://www.mysql.com/downloads/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)

+1

你可以從MYSQL [點擊這裏](http://dev.mysql.com/downloads/mysql/#downloads) – pavel 2012-07-31 11:33:31

回答

0

是的,你必須已經安裝的MySQL讓客戶端工作,因爲它依賴於MySQL客戶端代碼。我通常使用從MySQL,包括MySQL的,爲啓動腳本的安裝程序安裝程序可用的DMG下載和使用偏好窗格:

確保你得到正確的平臺你的系統。正如Quentin指出的那樣,問題在於Lion,它總是64位。

+0

它是獅子,只能運行在64位英特爾AFAIK上。當然不會在G5上運行。 – Quentin 2012-07-31 13:41:47

+0

對...呃... – zostay 2012-07-31 13:46:52

+0

問題是我已經在Lion上安裝了mysql(一個安裝了pkg,一個安裝了mamp)。 – 2012-07-31 16:31:26

0

我找到了解決辦法我自己,我採用的是MySQL的甲基苯丙胺安裝目錄,但顯然,這是不完整的,所以重新安裝後的MySQL我只是用這個選項:

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