Perl

Bugzilla 安裝 / perl-DBD-mysql

  • May 12, 2011

執行 ./checksetup.pl 時,安裝停止時出現此錯誤。

Reading ./localconfig...
Checking for            DBD-mysql (v4.00)     ok: found v4.018
Checking for                MySQL (v4.1.2)    ok: found v5.5.11

/usr/bin/perl: symbol lookup error: 
lib/i386-linux-thread-multi/auto/DBD/mysql/mysql.so: undefined symbol: is_prefix

Bugzilla 4.0.1 / CentOS 5.5

perl -v
This is perl, v5.8.8 built for i386-linux-thread-multi

mysql
Server version: 5.5.11 MySQL Community Server (GPL) by Remi

要做什麼?

謝謝,安迪


嘗試執行cpan> install DBD::mysql給出:

 /usr/bin/make  -- OK
Running make test
PERL_DL_NONLAZY=1 /usr/bin/perl "-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
t/00base.t .................. 1/6 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 '/root/.cpan/build/DBD-mysql-4.018/blib/arch/auto/DBD/mysql/mysql.so' for module DBD::mysql: /root/.cpan/build/DBD-mysql-4.018/blib/arch/auto/DBD/mysql/mysql.so: undefined symbol: is_prefix at /usr/lib/perl5/5.8.8/i386-linux-thread-multi/DynaLoader.pm line 230.
#  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
 /usr/bin/make test -- NOT OK
Running make install
 make test had returned bad status, won't install without force

至於perl -e 'use DBD::mysql;'這沒有給任何安慰,只是回到提示。

很明顯,您的 DBD 驅動程序的安裝出了點問題。

您可能應該直接從 CentOS 儲存庫安裝 Perl 模組:

yum install perl-DBD-MySQL

但是如果你有特定的原因使用 CPAN 客戶端安裝模組,它需要一個建構環境(即 C 編譯器)以及系統上的 MySQL C 標頭檔。通常,您可以通過安裝兩個額外的軟體包來做到這一點:

yum install mysql-devel libz-devel

現在您可以正確編譯 DBD 驅動程序了。

引用自:https://serverfault.com/questions/268548