免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 5240 | 回复: 5

安装perl DBD:mysql 出错,请帮忙看看 [复制链接]

论坛徽章:
0
发表于 2009-12-29 15:43 |显示全部楼层
想用mysqlreport 结果运行一下,告诉我说没有DBI
然后我装了DBI,再次运行mysqlreport 又告诉我没有DBD:mysql
这下装不起来了

perl Makefile.PL --mysql_config=/usr/local/mysql/bin/mysql_config --testuser=root --testpassword=123456
I will use the following settings for compiling and testing:

  cflags        (mysql_config ) = -I/usr/local/mysql/include/mysql
  embedded      (mysql_config ) =
  libs          (mysql_config ) = -L/usr/local/mysql/lib/mysql -lmysqlclient -lz -lcrypt -lnsl -lm
  mysql_config  (Users choice ) = /usr/local/mysql/bin/mysql_config
  nocatchstderr (default      ) = 0
  nofoundrows   (default      ) = 0
  ssl           (guessed      ) = 0
  testdb        (default      ) = test
  testhost      (default      ) =
  testpassword  (User's choice) = 123456
  testsocket    (default      ) =
  testuser      (User's choice) = root

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

Using DBI 1.604 (for perl 5.008008 on i386-linux-thread-multi) installed in /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/auto/DBI/
Writing Makefile for DBD::mysql

第一步正常

make test 出错

[root@webserver DBD-mysql-4.013]# make test
gcc -c  -I/usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/auto/DBI -I/usr/local/mysql/include/mysql -DDBD_MYSQL_INSERT_ID_IS_GOOD -g  -D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing -pipe -Wdeclaration-after-statement -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables   -DVERSION=\"4.013\" -DXS_VERSION=\"4.013\" -fPIC "-I/usr/lib/perl5/5.8.8/i386-linux-thread-multi/CORE"   dbdimp.c
dbdimp.c: In function ‘dbd_discon_all’:
dbdimp.c:1988: warning: unused variable ‘imp_xxh’
gcc -c  -I/usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/auto/DBI -I/usr/local/mysql/include/mysql -DDBD_MYSQL_INSERT_ID_IS_GOOD -g  -D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing -pipe -Wdeclaration-after-statement -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables   -DVERSION=\"4.013\" -DXS_VERSION=\"4.013\" -fPIC "-I/usr/lib/perl5/5.8.8/i386-linux-thread-multi/CORE"   mysql.c
mysql.xs: In function ‘XS_DBD__mysql__db_do’:
mysql.xs:242: warning: unused variable ‘statement_ptr’
mysql.xs: In function ‘XS_DBD__mysql__st_more_results’:
mysql.xs:588: warning: implicit declaration of function ‘mysql_st_next_results’
mysql.xs:587: warning: unused variable ‘retval’
mysql.xs: In function ‘XS_DBD__mysql__GetInfo_dbd_mysql_get_info’:
mysql.xs:724: warning: implicit declaration of function ‘is_prefix’
Running Mkbootstrap for DBD::mysql ()
chmod 644 mysql.bs
rm -f blib/arch/auto/DBD/mysql/mysql.so
/usr/bin/perl myld gcc  -shared -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -L/usr/local/lib dbdimp.o mysql.o  -o blib/arch/auto/DBD/mysql/mysql.so  \
           -L/usr/local/mysql/lib/mysql -lmysqlclient -lz -lcrypt -lnsl -lm     \
         
chmod 755 blib/arch/auto/DBD/mysql/mysql.so
cp mysql.bs blib/arch/auto/DBD/mysql/mysql.bs
chmod 644 blib/arch/auto/DBD/mysql/mysql.bs
PERL_DL_NONLAZY=1 /usr/bin/perl "-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
t/00base....................ok 1/6                                          
#   Failed test 'use DBD::mysql;'
#   in t/00base.t at line 21.
t/00base....................NOK 2#     Tried to use 'DBD::mysql'.            
#     Error:  Can't load '/home/tony.liu/DBD-mysql-4.013/blib/arch/auto/DBD/mysql/mysql.so' for module DBD::mysql: libmysqlclient.so.15: cannot open shared object file: No such file or directory at /usr/lib/perl5/5.8.8/i386-linux-thread-multi/DynaLoader.pm line 230.
#  at (eval 6) line 2
# Compilation failed in require at (eval 6) line 2.
# BEGIN failed--compilation aborted at t/00base.t line 21.
FAILED--Further testing stopped: Unable to load DBD::mysql
make: *** [test_dynamic] Error 9

论坛徽章:
0
发表于 2009-12-29 15:51 |显示全部楼层
换了4.006这个版本 DBD:mysql 好像装上去了
但是 运行 mysqlreport 报错

install_driver(mysql) failed: Can't load '/usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/auto/DBD/mysql/mysql.so' for module DBD::mysql: libmysqlclient.so.15: cannot open shared object file: No such file or directory at /usr/lib/perl5/5.8.8/i386-linux-thread-multi/DynaLoader.pm line 230.
at (eval 7) line 3
Compilation failed in require at (eval 7) line 3.
Perhaps a required shared library or dll isn't installed where expected
at ./mysqlreport line 249

论坛徽章:
18
巳蛇
日期:2014-12-03 08:27:5115-16赛季CBA联赛之吉林
日期:2016-04-18 15:24:24qiaoba
日期:2016-06-17 17:41:1615-16赛季CBA联赛之八一
日期:2016-06-20 15:13:1415-16赛季CBA联赛之广夏
日期:2016-06-29 10:38:28极客徽章
日期:2016-12-07 14:03:4015-16赛季CBA联赛之吉林
日期:2017-03-06 13:47:55
发表于 2009-12-29 16:06 |显示全部楼层
# cpan DBD:mysql

论坛徽章:
0
发表于 2009-12-29 16:15 |显示全部楼层
原帖由 gilet 于 2009-12-29 16:06 发表
# cpan DBD:mysql


ommit: wrote /usr/lib/perl5/5.8.8/CPAN/Config.pm
CPAN: Storable loaded ok
Fetching with LWP:
  http://cpan.wenzk.com/authors/01mailrc.txt.gz
Going to read /root/.cpan/sources/authors/01mailrc.txt.gz
Fetching with LWP:
  http://cpan.wenzk.com/modules/02packages.details.txt.gz
Going to read /root/.cpan/sources/modules/02packages.details.txt.gz
  Database was generated on Tue, 29 Dec 2009 06:34:27 GMT

  There's a new CPAN.pm version (v1.9402) available!
  [Current version is v1.7602]
  You might want to try
    install Bundle::CPAN
    reload cpan
  without quitting the current session. It should be a seamless upgrade
  while we are running...

Fetching with LWP:
  http://cpan.wenzk.com/modules/03modlist.data.gz
Going to read /root/.cpan/sources/modules/03modlist.data.gz
Going to write /root/.cpan/Metadata
Warning: Cannot install DBD:mysql, don't know what it is.
Try the command

    i /DBD:mysql/

to find objects with matching identifiers.

运行脚本
#!/usr/bin/perl
use ExtUtils::Installed;

my $inst = ExtUtils::Installed->new();
print join "\n",$inst->modules();

得到
DBD::mysql
DBI
DCOP
Image::Magick
Perl

应该已经装上了DBD::mysql
但是 运行mysqlreport

install_driver(mysql) failed: Can't load '/usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/auto/DBD/mysql/mysql.so' for module DBD::mysql: libmysqlclient.so.15: cannot open shared object file: No such file or directory at /usr/lib/perl5/5.8.8/i386-linux-thread-multi/DynaLoader.pm line 230.
at (eval 7) line 3
Compilation failed in require at (eval 7) line 3.
Perhaps a required shared library or dll isn't installed where expected
at ./mysqlreport line 249

论坛徽章:
0
发表于 2009-12-29 16:28 |显示全部楼层
cpan DBD::mysql

论坛徽章:
0
发表于 2009-12-30 16:34 |显示全部楼层
echo "" > /etc/ld.so.conf
echo "/usr/lib/mysql/" > /etc/ld.so.conf
ldconfig

[ 本帖最后由 pluschen 于 2009-12-30 16:36 编辑 ]
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP