57IT首页|技术文章|软件下载|教程下载|图片频道|网赚推荐
   位置: 57IT信息网 >> 技术文章 >> Other Server >> LINUX技术 >> 正文
最新调查
  • 没有任何调查
  • 频道统计


    Trubo Linux 10下为Perl安装DBD::Mysql模块[57IT信息网]




    Trubo Linux 10下为Perl安装DBD::Mysql模块[57IT信息网]
     更新时间:2008-1-7 5:00:05  点击数:83
    【字体:
    linux下使用perl -MCPAN来安装模块,具体用法查看帮助
    perl -MCPAN -h
    perl -MCPAN 初次使用时提示设置,基本上一路回车到选择区域和国家
    设置保存在
    /usr/lib/perl5/5.8.0/CPAN/Config.pm
    设置可以修改此文件或干脆删除它再运行perl -MCAPN -e shell重新设置
    下边开始安装
    perl -MCPAN -e shell
    首先要安装DBI模块,这个在trubolinux10下没问题,
    cpan> install DBI
    然后安装DBD::mysql模块
    cpan> install DBD::mysql
    提示出错退出:
    t/mysql2.t         255 65280    ??   ??       %  ??
    1 test skipped.
    Failed 16/18 test scripts, 11.11% okay. 723/730 subtests failed, 0.96% okay.
    make: *** [test_dynamic] 错误 2
      /usr/bin/make test -- NOT OK
    Running make install
      make test had returned bad status, won't install without force
    向上找发现
    Can't exec "mysql_config": 没有那个文件或目录 at Makefile.PL line 174.
    readline() on closed filehandle PIPE at Makefile.PL line 176.
    cpan> q
    退出
    [root@localhost sources]#vim /root/.cpan/build/DBD-mysql-2.9004/Makefile.PL
    输入/mysql_config查找发现
    open(PIPE, "mysql_config --$param |");
    open(PIPE, "/usr/local/mysql/bin/mysql_config --$param |"); #修改此处,
    运行
    [root@localhost sources]#cd /root/.cpan/build/DBD-mysql-2.9004
    [root@localhost sources]#perl Makefile.PL --h
    Usage: perl /root/.cpan/build/DBD-mysql-2.9004/Makefile.PL [options]

    Possible options are:

      --cflags=       Use  for running the C compiler; defaults
                             to the value of "mysql_config --cflags"
      --libs=          Use  for running the linker; defaults
                             to the value of "mysql_config --libs"
      --testdb=          Use the database  for running the test suite;
                             defaults to test
      --testuser=      Use the username  for running the test suite;
                             defaults to no username
      --testpassword=   Use the password  for running the test suite;
                             defaults to no password
      --testhost=      Use  as a database server for running the
                             test suite; defaults to localhost.
      --testport=      Use  as the port number of the database;
                             by default the port number is choosen from the
                             mysqlclient library
      --nocatchstderr        Supress using the "myld" script that redirects
                             STDERR while running the linker.
      --nofoundrows          Change the behavoiur of $sth->rows() so that it
                             returns the number of rows physically modified
                             instead of the rows matched
      --ssl                  Enable SSL support
      --help                 Print this message and exit

    All options may be configured on the command line. If they are
    not present on the command line, then mysql_config is called:

      mysql_config --cflags
      mysql_config --libs
      mysql_config --testdb

    and so on. See the INSTALL.html file for details.
    按提示输入
    [root@localhost sources]#perl Makefile.PL --testuser=root --testpassword=password
    输入数据库的用户名和密码
    这次没有提示错误,然后输入
    [root@localhost sources]#make
    [root@localhost sources]#make test
    [root@localhost sources]#make install
    完成安装;

  • 上一篇: AS4 mysql4 安装配置
  • 下一篇: Linux安全配置步骤简述

  • 销售冠军NO.1 淘宝网二手本最热卖产品 单品狂销千件
    1690.0元 
    人见人爱 超簿迅驰1.4G 512M 40G 康
    1799.0元 
    发表评论   告诉好友   打印此文  收藏此页  关闭窗口  返回顶部
    热点文章
     
    推荐文章
     
    相关文章

    网友评论:(只显示最新5条。)



    | 关于本站 | 设为首页 | 加入收藏 | 站长邮箱 | 友情链接 | 与我同在 | 版权申明 | 联系我们 |


    Copyright© 2007-2008 57IT.Com .All Rights Reserved 桂ICP备07500909号