Professional Web Applications Themes

installing perl module for mysql driver - PERL Beginners

Im trying to install the module DBD::mysql so I can connect to a mysql database from a perl script. The instructions for installing told me to run the command: perl -MCPAN -e 'install Bundle::DBD::mysql' this did its thing, downloaded and unzipped some gz gfiles, etc. Then said everything was ok when it was done. I tried to run my script and it said it couldnt find the DBD:mysql module. So I checked my perl lib directories and there is no mysql.pm file anywhere in sight. I tried a million things, like actually placing the mysql.pm file in my lib directories ...

  1. #1

    Default installing perl module for mysql driver

    Im trying to install the module DBD::mysql so I can connect to a mysql
    database from a perl script. The instructions for installing told me to
    run the command:

    perl -MCPAN -e 'install Bundle::DBD::mysql'

    this did its thing, downloaded and unzipped some gz gfiles, etc. Then said
    everything was ok when it was done. I tried to run my script and it said
    it couldnt find the DBD:mysql module. So I checked my perl lib directories
    and there is no mysql.pm file anywhere in sight. I tried a million things,
    like actually placing the mysql.pm file in my lib directories then
    installing that file with (perl -MCPAN -e 'install DBD::mysql'), which
    seemed to install just fine, but the scipt still gives me errors.

    Now when I try to reinstall the whole bundle it gives me this error:
    ________________________
    [i took out other stuff from here]
    DBD-mysql-2.9003/dbdimp.h
    DBD-mysql-2.9003/mysql.xs
    DBD-mysql-2.9003/MANIFEST.SKIP
    DBD-mysql-2.9003/README
    DBD-mysql-2.9003/INSTALL.html
    DBD-mysql-2.9003/Makefile.PL
    DBD-mysql-2.9003/ChangeLog
    DBD-mysql-2.9003/constants.h
    DBD-mysql-2.9003/TODO
    Removing previously used /root/.cpan/build/DBD-mysql-2.9003

    CPAN.pm: Going to build R/RU/RUDY/DBD-mysql-2.9003.tar.gz

    Can't exec "mysql_config": No such file or directory at Makefile.PL line
    174.
    readline() on closed filehandle PIPE at Makefile.PL line 176.
    Can't exec "mysql_config": No such file or directory at Makefile.PL line
    174.
    readline() on closed filehandle PIPE at Makefile.PL line 176.
    Can't exec "mysql_config": No such file or directory at Makefile.PL line
    174.
    readline() on closed filehandle PIPE at Makefile.PL line 176.
    Can't exec "mysql_config": No such file or directory at Makefile.PL line
    174.
    readline() on closed filehandle PIPE at Makefile.PL line 176.
    Can't exec "mysql_config": No such file or directory at Makefile.PL line
    174.
    readline() on closed filehandle PIPE at Makefile.PL line 176.
    Failed to determine directory of mysql.h. Use

    perl Makefile.PL --cflags=-I<dir>

    to set this directory. For details see the INSTALL.html file,
    section "C Compiler flags" or type

    perl Makefile.PL --help
    Running make test
    Make had some problems, maybe interrupted? Won't test
    Running make install
    Make had some problems, maybe interrupted? Won't install
    DBD::mysql is up to date.
    Bundle summary: The following items in bundle Bundle::DBD::mysql had
    installation problems:
    Mysql

    _____________________________

    And when i try to install run my perl scipt the error I get is still:

    _______
    install_driver(mysql) failed: Can't locate loadable object for module
    DBD::mysql in INC (INC contains: /usr/lib/perl5/5.6.1/i386-linux
    /usr/lib/perl5/5.6.1 /usr/lib/perl5/site_perl/5.6.1/i386-linux
    /usr/lib/perl5/site_perl/5.6.1 /usr/lib/perl5/site_perl/5.6.0
    /usr/lib/perl5/site_perl /usr/lib/perl5/vendor_perl/5.6.1/i386-linux
    /usr/lib/perl5/vendor_perl/5.6.1 /usr/lib/perl5/vendor_perl .) at (eval 1)
    line 3
    Compilation failed in require at (eval 1) line 3.
    Perhaps a module that DBD::mysql requires hasn't been fully installed
    at load_data.pl line 18
    _______


    So, I guess the most interesting msg it gives me is "Failed to determine
    directory of mysql.h.". Do I need to install some sort of other mysql
    stuff on the server running perl? Because the mysql database Im trying to
    access is on a different server?

    Any ideas at all? Anything? Please? Please? Thanks all.


    Perldiscuss Guest

  2. #2

    Default Re: installing perl module for mysql driver

    > Im trying to install the module DBD::mysql so I can connect to a mysql 

    You have to have the c libraries for mysql installed, and generally the
    'mysql_config' program that is installed with the dev kit in your path.
    The module installation procedures execute it to find out where the
    libraries and headers are for your mysql installation. You do not need
    the full client or the server components, but you do need at least the
    dev kit. Check that these are installed, check that the lib and include
    paths are set properly, remove the file you placed manually, and try
    re-running the install.

    HTH,

    http://danconia.org


    Wiggins Guest

  3. #3

    Default Re: installing perl module for mysql driver

    I believe I had the same problem as you, based off two identical RedHat 9
    boxes I have except for mysql, the difference is in the /etc/ld.so.conf

    mysql added:
    /usr/kerberos/lib
    /usr/X11R6/lib
    /usr/lib/qt-3.0.5/lib
    /usr/lib/sane
    /usr/local/lib
    /usr/lib

    non-mysql box:
    /usr/kerberos/lib
    /usr/X11R6/lib
    /usr/lib/sane
    /usr/lib/qt-3.1/lib

    the libmysqlclient libraries are in
    [x.x.x.x etc]# ls /usr/lib/*my*
    /usr/lib/libmysqlclient_r.so /usr/lib/libodbcmyS.a
    /usr/lib/libmysqlclient_r.so.10 /usr/lib/libodbcmyS.so
    /usr/lib/libmysqlclient_r.so.10.0.0 /usr/lib/libodbcmyS.so.1
    /usr/lib/libmysqlclient.so /usr/lib/libodbcmyS.so.1.0.0
    /usr/lib/libmysqlclient.so.10
    /usr/lib/libmysqlclient.so.10.0.0




    Rich Richmond

    RS Information Systems
    Systems/Network yst, DARPA
    (W) 703-526-4012 (C) 703-946-3381





    Arichmond Guest

Similar Threads

  1. Installing DBD:Oracle module on Perl 5.8.4
    By szikria in forum PERL Modules
    Replies: 2
    Last Post: October 6th, 09:35 AM
  2. Installing DBI module for Perl 5.8.4
    By szikria in forum PERL Modules
    Replies: 2
    Last Post: October 5th, 06:01 PM
  3. Installing JDBC MySQL driver
    By Bloke in forum Coldfusion - Getting Started
    Replies: 23
    Last Post: May 31st, 12:32 AM
  4. installing perl module without root permission
    By Jayakumar in forum PERL Beginners
    Replies: 11
    Last Post: May 3rd, 05:47 PM
  5. Problem installing Perl-RPM module on a RedHat 9.0
    By Steve Houle in forum PERL Modules
    Replies: 1
    Last Post: September 24th, 06:25 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139