2011-08-22 3 views
3

sudo cpanm -S DBD::mysql을 비롯한 대부분의 일반적인 방법을 사용하여 DBD :: mysql을 설치하려고합니다. 그러나이 문제에 심각한 문제가 있으며 내 프로세서라고 생각하기 시작했습니다. 나는 이것을 많은 컴퓨터에 성공적으로 설치했지만, IT 부서가 나에게이 i5 MacBook Pro, 운이 없었기 때문에 모든 것을 성공적으로 설치했습니다. 다른 누군가가 i5에 DBD :: mysql을 설치할 수 있습니까? 저는 Mac OS 10.6.8을 사용하고 있습니다.누구나 i5 프로세서가 장착 된 Mac Snow Leopard에 DBD :: mysql을 설치할 수 있습니까?

여기에 cpanm을 실행 한 후 build.log가 있습니다. 어떤 도움을 주시면 감사하겠습니다. 고맙습니다!

cpanm (App::cpanminus) 1.4008 on perl 5.010000 built for darwin-thread-multi-2level 
Work directory is /Users/jerickson/.cpanm/work/1314049977.98062 
You have make /usr/bin/make 
You have LWP 5.813 
You have /usr/bin/tar: bsdtar 2.6.2 - libarchive 2.6.2 
You have /usr/bin/unzip 
Searching DBD::mysql on cpanmetadb ... 
--> Working on DBD::mysql 
Fetching http://search.cpan.org/CPAN/authors/id/C/CA/CAPTTOFU/DBD-mysql-4.020.tar.gz 
-> OK 
Unpacking DBD-mysql-4.020.tar.gz 
Entering DBD-mysql-4.020 
Checking configure dependencies from META.yml 
Checking if you have DBI 1.08 ... Yes (1.616) 
Configuring DBD-mysql-4.020 
Running Makefile.PL 


PLEASE NOTE: 

For 'make test' to run properly, you must ensure that the 
database user 'root' can connect to your MySQL server 
and has the proper privileges that these tests require such 
as 'drop table', 'create table', 'drop procedure', 'create procedure' 
as well as others. 

mysql> grant all privileges on test.* to 'root'@'localhost' identified by 's3kr1t'; 

You can also optionally set the user to run 'make test' with: 

perl Makefile.PL --testuser=username 

I will use the following settings for compiling and testing: 

    cflags  (mysql_config) = -I/usr/local/mysql/include -Os -g -fno-common -fno-strict-aliasing -arch x86_64 
    embedded  (mysql_config) = 
    libs   (mysql_config) = -L/usr/local/mysql/lib -lmysqlclient -lpthread 
    mysql_config (guessed ) = mysql_config 
    nocatchstderr (default ) = 0 
    nofoundrows (default ) = 0 
    ssl   (guessed ) = 0 
    testdb  (default ) = test 
    testhost  (default ) = 
    testpassword (default ) = 
    testsocket (default ) = 
    testuser  (guessed ) = root 

To change these settings, see 'perl Makefile.PL --help' and 
'perldoc INSTALL'. 

Checking if your kit is complete... 
Looks good 
Using DBI 1.616 (for perl 5.010000 on darwin-thread-multi-2level) installed in /Library/Perl/5.10.0/darwin-thread-multi-2level/auto/DBI/ 
Writing Makefile for DBD::mysql 
Writing MYMETA.yml and MYMETA.json 
-> OK 
Checking dependencies from MYMETA.yml ... 
Finding PREREQ from Makefile ... 
Checking if you have Data::Dumper 0 ... Yes (2.121_14) 
Checking if you have DBI 1.08 ... Yes (1.616) 
Checking if you have Test::More 0 ... Yes (0.98) 
Checking if you have Test::More 0 ... Yes (0.98) 
Checking if you have Data::Dumper 0 ... Yes (2.121_14) 
Checking if you have DBI 1.08 ... Yes (1.616) 
Building and testing DBD-mysql-4.020 
cp lib/DBD/mysql.pm blib/lib/DBD/mysql.pm 
cp lib/DBD/mysql/GetInfo.pm blib/lib/DBD/mysql/GetInfo.pm 
cp lib/DBD/mysql/INSTALL.pod blib/lib/DBD/mysql/INSTALL.pod 
cp lib/Bundle/DBD/mysql.pm blib/lib/Bundle/DBD/mysql.pm 
gcc-4.2 -c -I/Library/Perl/5.10.0/darwin-thread-multi-2level/auto/DBI -I/usr/local/mysql/include -Os -g -fno-common -fno-strict-aliasing -arch x86_64 -DDBD_MYSQL_INSERT_ID_IS_GOOD -g -arch x86_64 -arch i386 -arch ppc -g -pipe -fno-common -DPERL_DARWIN -fno-strict-aliasing -I/usr/local/include -Os -DVERSION=\"4.020\" -DXS_VERSION=\"4.020\" "-I/System/Library/Perl/5.10.0/darwin-thread-multi-2level/CORE" dbdimp.c 
dbdimp.c: In function ‘alloc_param’: 
dbdimp.c:223: warning: format not a string literal and no format arguments 
dbdimp.c: In function ‘alloc_bind’: 
dbdimp.c:241: warning: format not a string literal and no format arguments 
dbdimp.c: In function ‘alloc_fbind’: 
dbdimp.c:257: warning: format not a string literal and no format arguments 
dbdimp.c: In function ‘alloc_fbuffer’: 
dbdimp.c:272: warning: format not a string literal and no format arguments 
dbdimp.c: In function ‘parse_params’: 
dbdimp.c:589: warning: format not a string literal and no format arguments 
dbdimp.c: In function ‘my_login’: 
dbdimp.c:1996: warning: format not a string literal and no format arguments 
dbdimp.c: In function ‘mysql_describe’: 
dbdimp.c:3605: warning: assignment from incompatible pointer type 
dbdimp.c:3606: warning: format not a string literal and no format arguments 
dbdimp.c: In function ‘mysql_st_fetch’: 
dbdimp.c:3798: warning: format not a string literal and no format arguments 
dbdimp.c: In function ‘alloc_param’: 
dbdimp.c:223: warning: format not a string literal and no format arguments 
dbdimp.c: In function ‘alloc_bind’: 
dbdimp.c:241: warning: format not a string literal and no format arguments 
dbdimp.c: In function ‘alloc_fbind’: 
dbdimp.c:257: warning: format not a string literal and no format arguments 
dbdimp.c: In function ‘alloc_fbuffer’: 
dbdimp.c:272: warning: format not a string literal and no format arguments 
dbdimp.c: In function ‘parse_params’: 
dbdimp.c:589: warning: format not a string literal and no format arguments 
dbdimp.c: In function ‘my_login’: 
dbdimp.c:1996: warning: format not a string literal and no format arguments 
dbdimp.c: In function ‘mysql_describe’: 
dbdimp.c:3605: warning: assignment from incompatible pointer type 
dbdimp.c:3606: warning: format not a string literal and no format arguments 
dbdimp.c: In function ‘mysql_st_fetch’: 
dbdimp.c:3798: warning: format not a string literal and no format arguments 
dbdimp.c: In function ‘alloc_param’: 
dbdimp.c:223: warning: format not a string literal and no format arguments 
dbdimp.c: In function ‘alloc_bind’: 
dbdimp.c:241: warning: format not a string literal and no format arguments 
dbdimp.c: In function ‘alloc_fbind’: 
dbdimp.c:257: warning: format not a string literal and no format arguments 
dbdimp.c: In function ‘alloc_fbuffer’: 
dbdimp.c:272: warning: format not a string literal and no format arguments 
dbdimp.c: In function ‘parse_params’: 
dbdimp.c:589: warning: format not a string literal and no format arguments 
dbdimp.c: In function ‘my_login’: 
dbdimp.c:1996: warning: format not a string literal and no format arguments 
dbdimp.c: In function ‘mysql_describe’: 
dbdimp.c:3605: warning: assignment from incompatible pointer type 
dbdimp.c:3606: warning: format not a string literal and no format arguments 
dbdimp.c: In function ‘mysql_st_fetch’: 
dbdimp.c:3798: warning: format not a string literal and no format arguments 
/usr/bin/perl -p -e "s/~DRIVER~/mysql/g" /Library/Perl/5.10.0/darwin-thread-multi-2level/auto/DBI/Driver.xst > mysql.xsi 
/usr/bin/perl /Library/Perl/Updates/5.10.0/ExtUtils/xsubpp -typemap /System/Library/Perl/5.10.0/ExtUtils/typemap mysql.xs > mysql.xsc && mv mysql.xsc mysql.c 
Warning: duplicate function definition 'do' detected in mysql.xs, line 242 
Warning: duplicate function definition 'rows' detected in mysql.xs, line 751 
gcc-4.2 -c -I/Library/Perl/5.10.0/darwin-thread-multi-2level/auto/DBI -I/usr/local/mysql/include -Os -g -fno-common -fno-strict-aliasing -arch x86_64 -DDBD_MYSQL_INSERT_ID_IS_GOOD -g -arch x86_64 -arch i386 -arch ppc -g -pipe -fno-common -DPERL_DARWIN -fno-strict-aliasing -I/usr/local/include -Os -DVERSION=\"4.020\" -DXS_VERSION=\"4.020\" "-I/System/Library/Perl/5.10.0/darwin-thread-multi-2level/CORE" mysql.c 
mysql.xs: In function ‘XS_DBD__mysql__db_do’: 
mysql.xs:307: warning: format ‘%d’ expects type ‘int’, but argument 4 has type ‘struct SV *’ 
mysql.xs:364: warning: format not a string literal and no format arguments 
mysql.xs:365: warning: format not a string literal and no format arguments 
mysql.xs:366: warning: format not a string literal and no format arguments 
mysql.xs:525: warning: format not a string literal and no format arguments 
mysql.xs: In function ‘XS_DBD__mysql__GetInfo_dbd_mysql_get_info’: 
mysql.xs:930: warning: format ‘%i’ expects type ‘int’, but argument 2 has type ‘struct SV *’ 
mysql.xs: In function ‘XS_DBD__mysql__db_do’: 
mysql.xs:307: warning: format ‘%d’ expects type ‘int’, but argument 4 has type ‘struct SV *’ 
mysql.xs:364: warning: format not a string literal and no format arguments 
mysql.xs:365: warning: format not a string literal and no format arguments 
mysql.xs:366: warning: format not a string literal and no format arguments 
mysql.xs:525: warning: format not a string literal and no format arguments 
mysql.xs: In function ‘XS_DBD__mysql__GetInfo_dbd_mysql_get_info’: 
mysql.xs:930: warning: format ‘%i’ expects type ‘int’, but argument 2 has type ‘struct SV *’ 
mysql.xs: In function ‘XS_DBD__mysql__db_do’: 
mysql.xs:307: warning: format ‘%d’ expects type ‘int’, but argument 4 has type ‘struct SV *’ 
mysql.xs:364: warning: format not a string literal and no format arguments 
mysql.xs:365: warning: format not a string literal and no format arguments 
mysql.xs:366: warning: format not a string literal and no format arguments 
mysql.xs:525: warning: format not a string literal and no format arguments 
mysql.xs: In function ‘XS_DBD__mysql__GetInfo_dbd_mysql_get_info’: 
mysql.xs:930: warning: format ‘%i’ expects type ‘int’, but argument 2 has type ‘struct SV *’ 
Running Mkbootstrap for DBD::mysql() 
chmod 644 mysql.bs 
rm -f blib/arch/auto/DBD/mysql/mysql.bundle 
LD_RUN_PATH="/usr/local/mysql/lib:/usr/lib" /usr/bin/perl myld gcc-4.2 -mmacosx-version-min=10.6.3 -arch x86_64 -arch i386 -arch ppc -bundle -undefined dynamic_lookup -L/usr/local/lib dbdimp.o mysql.o -o blib/arch/auto/DBD/mysql/mysql.bundle  \ 
     -L/usr/local/mysql/lib -lmysqlclient -lpthread \ 

chmod 755 blib/arch/auto/DBD/mysql/mysql.bundle 
cp mysql.bs blib/arch/auto/DBD/mysql/mysql.bs 
chmod 644 blib/arch/auto/DBD/mysql/mysql.bs 
Manifying blib/man3/DBD::mysql.3pm 
Manifying blib/man3/DBD::mysql::INSTALL.3pm 
Manifying blib/man3/Bundle::DBD::mysql.3pm 
PERL_DL_NONLAZY=1 /usr/bin/perl "-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib/lib', 'blib/arch')" t/*.t 
Bailout called. Further testing stopped: Unable to load DBD::mysql 

# Failed test 'use DBD::mysql;' 
# at t/00base.t line 21. 
#  Tried to use 'DBD::mysql'. 
#  Error: Can't load '/Users/jerickson/.cpanm/work/1314049977.98062/DBD-mysql-4.020/blib/arch/auto/DBD/mysql/mysql.bundle' for module DBD::mysql: dlopen(/Users/jerickson/.cpanm/work/1314049977.98062/DBD-mysql-4.020/blib/arch/auto/DBD/mysql/mysql.bundle, 2): Library not loaded: libmysqlclient.18.dylib 
# Referenced from: /Users/jerickson/.cpanm/work/1314049977.98062/DBD-mysql-4.020/blib/arch/auto/DBD/mysql/mysql.bundle 
# Reason: image not found at /System/Library/Perl/5.10.0/darwin-thread-multi-2level/DynaLoader.pm line 207. 
# at (eval 7) line 2 
# Compilation failed in require at (eval 7) line 2. 
# BEGIN failed--compilation aborted at (eval 7) line 2. 
FAILED--Further testing stopped: Unable to load DBD::mysql 
make: *** [test_dynamic] Error 255 
-> FAIL Installing DBD::mysql failed. See /Users/jerickson/.cpanm/build.log for details. 

나는 그 후 sudo cpanm -Sf DBD::mysql을 시도했다.

Running... 
install_driver(mysql) failed: Can't load '/Library/Perl/5.10.0/darwin-thread-multi-2level/auto/DBD/mysql/mysql.bundle' for module DBD::mysql: dlopen(/Library/Perl/5.10.0/darwin-thread-multi-2level/auto/DBD/mysql/mysql.bundle, 1): Library not loaded: libmysqlclient.18.dylib 
    Referenced from: /Library/Perl/5.10.0/darwin-thread-multi-2level/auto/DBD/mysql/mysql.bundle 
    Reason: image not found at /System/Library/Perl/5.10.0/darwin-thread-multi-2level/DynaLoader.pm line 207. 
at (eval 6) line 3 
Compilation failed in require at (eval 6) line 3. 
Perhaps a required shared library or dll isn't installed where expected 
at roster_generate.pl line 33 
+0

FWIW 그것은 나중에 잘 작동 것 : 여기에서 각각이 작업을 수행하는 명령입니다. 나는 이것이 "정확한"충고가 아니라는 것을 깨닫는다. 그러나 그것은 10 년 동안 계속해서 반복해서하는 슬픔을 느끼게하지는 못했다. – Ashley

+0

@Ashley -Sf 플래그를 강제로 설치하려고 시도했지만 성공적으로 설치되었다고하지만, 여전히 Perl 스크립트에서 사용할 수는 없습니다. 수정 된 게시물을 참조하십시오. –

답변

4

아, 내가

을 추가하여 문제를 해결할 수 있었다 : force 플래그를 사용 cpanm 그러나이 오류와 함께 MySQL 데이터베이스 결과에 연결을 포함하는 스크립트를 실행하려고, 그것은 성공적으로 설치되었는지 말한다

export DYLD_LIBRARY_PATH="$DYLD_LIBRARY_PATH:/usr/local/mysql/lib/"

: my .bash_profile. 나는 이것을 임의의 블로그에서 발견했다. 왜 이것이 효과가 있었는지 아는 사람 ??

+0

다음은 출처입니다. http://www.blog.bridgeutopiaweb.com/post/how-to-fix-mysql-load-issues-on-mac-os-x/ –

+1

고마워요! 이것은 내 MySQL을 완료하는 데 도움이 <-> DBD 설치! – BaL

+0

올바른 링크는 지금 http://c.kat.pe/post/how-to-fix-mysql-load-issues-on-mac-os-x/ – kgpdeveloper

0

나는 최근 DBD :: mysql 패키지를 완전히 다른 컴퓨터에 설치하려고 시도했다. 설치 프로그램은 mysql-devel 패키지의 특정 라이브러리가 필요합니다. 불행히도이 사실을 알려주지는 않습니다. 이 mysql-devel 패키지를 yum으로 설치 한 후 설치가 아무 문제없이 진행되었습니다.

DYLD_LIBRARY_PATH 변수를 설정하면 설치 프로그램이 필요한 라이브러리를 찾기 위해 /usr/local/mysql/lib/을 찾습니다.

2

다음은 Snow Leopard에서 작업 할 수있는 항목입니다. symlink라는 Dark Ages에서 온 오래된 리눅스 트릭입니다.

cd/usr/lib sudo ln -sv /usr/local/mysql/lib/*.dylib.

환경 변수 DYLD_LIBRARY_PATH 설정에 지장을주지 마십시오. sudo는 부팅을 원치 않는 메시지를 존중하지 않고 제공하기 때문입니다.

DBD :: mysql과 몇 가지 다른 것들을 (마지막으로) 컴파일 할 수있었습니다.

행운을 비네.

1

Mac OSX Mavericks를 사용하는 모든 사람에게 마침내이 모듈을 작동시키는 단계가 있습니다.

먼저 DBD :: mysql이 이미 설치되어 있으면 제거하십시오.

sudo cpanm -U DBD::mysql 

MySQL lib 파일을 링크하려면 다음 명령을 실행하십시오. Jjohn이 언급했듯이 DYLD_LIBRARY_PATH 변수 설정은 작동하지 않습니다.

cd /usr/lib 
sudo ln -sv /usr/local/mysql/lib/*.dylib . 

DBD :: mysql을 다시 설치하십시오 (-n 플래그는 테스트 단계를 건너 뜁니다).

그게 전부 야!

좋은 측정을 위해 Perl이 32 비트 모드로 실행되도록 구성했으며 Apache를 다시 시작했습니다. 그러나 이러한 단계가 필요한지 확실하지 않습니다. 공개 베타 이후 모든 OS의 X에 MySQL의 :: 나는 일반적으로 같은 히트 발행하고 힘 DBD를 설치 한,

defaults write com.apple.versioner.perl Prefer-32-Bit -bool yes 
sudo apachectl restart 
관련 문제