problem installing DBD/mysql.pm

Discussion in 'Perl Misc' started by mmccaws2, Nov 7, 2007.

  1. mmccaws2

    mmccaws2 Guest

    I'm getting closer but don't know where I going wrong. On HPUX system
    and had to manually install DBI and DBD-mysql modules. the error
    message says
    error message begin
    DBD::mysql initialisation failed: Can't locate object method "driver"
    via package "DBD::mysql" at /opt/perl_32/lib/5.8.8/IA64.ARCHREV_0-
    thread-multi/DBI.pm line 782.

    Perhaps the capitalisation of DBD 'mysql' isn't right. at ./conntst.pl
    line 6
    error message end


    now the install seems to have installed it in my .cpan directory

    /home/mmcca/.cpan/Bundle/DBD/mysql.pm

    so in the test script I put a lib statement. Am I using lib correctly
    or do I need a different method to have mysql.pm visible to the DBI
    module? Below the code is the original error message.

    #!/usr/bin/perl
    use strict;
    use lib '/home/mmcca/.cpan/Bundle';
    use DBI;

    my $dbh = DBI->connect('DBI:mysql:smartcard:localhost', 'root',
    'Welcome1',
    {RaiseError => 1});
    if ($dbh) {
    print "Successfully connected to the database\n";
    }
    $dbh->disconnect;

    orignal error message
    $ ./conntst.pl
    install_driver(mysql) failed: Can't locate DBD/mysql.pm in @INC (@INC
    contains: /home/mccannm/.cpan/Bundle/DBD /opt/perl_32/lib/5.8.8/
    IA64.ARCHREV_0-thread-multi /opt/perl_32/lib/5.8.8 /opt/perl_32/lib/
    site_perl/5.8.8/IA64.ARCHREV_0-thread-multi /opt/perl_32/lib/site_perl/
    5.8.8 /opt/perl_32/lib/site_perl /opt/perl_32/lib/vendor_perl/5.8.8/
    IA64.ARCHREV_0-thread-multi /opt/perl_32/lib/vendor_perl/5.8.8 /opt/
    perl_32/lib/vendor_perl .) at (eval 4) line 3.
    Perhaps the DBD::mysql perl module hasn't been fully installed,
    or perhaps the capitalisation of 'mysql' isn't right.
    Available drivers: DBM, ExampleP, File, Gofer, Proxy, SQLite, Sponge,
    mysqlPP.
    at ./conntst.pl line 6
    mmccaws2, Nov 7, 2007
    #1
    1. Advertising

  2. mmccaws2

    mmccaws2 Guest

    On Nov 7, 3:33 am, Sherman Pendley <> wrote:
    > mmccaws2 <> writes:
    > > now the install seems to have installed it in my .cpan directory

    >
    > Modules are never installed there. What you are looking at is a temporary
    > file created during the process of unzipping and building the module with
    > the CPAN shell.
    >
    > > /home/mmcca/.cpan/Bundle/DBD/mysql.pm

    >
    > That's not even a module - it's a bundle file. Little wonder Perl couldn't
    > load it as a DBD driver.
    >
    > > so in the test script I put a lib statement. Am I using lib correctly
    > > or do I need a different method to have mysql.pm visible to the DBI
    > > module?

    >
    > When it's installed correctly, you won't need a lib statement.
    >
    > Reverse course and back up a bit - you need to figure out why the module
    > is not installed correctly. Pay close attention to what gets printed when
    > you run the install - it will tell you about any errors in the process.
    >
    > sherm--
    >
    > --
    > WV News, Blogging, and Discussion:http://wv-www.com
    > Cocoa programming in Perl:http://camelbones.sourceforge.net


    So if I run perl Makefile.PL, make, make test, make install this
    process removes the previous, or just over writes the previous. Or is
    there an uninstall process that needs to be run.

    Mike
    mmccaws2, Nov 7, 2007
    #2
    1. Advertising

  3. mmccaws2

    Ben Morrow Guest

    Quoth mmccaws2 <>:
    >
    > So if I run perl Makefile.PL, make, make test, make install this
    > process removes the previous, or just over writes the previous. Or is
    > there an uninstall process that needs to be run.


    Overwrites. If you run make install UNINST=1 it will attempt to remove
    conflicting modules in other parts of the Perl module tree, but this is
    not the same as uninstalling the whole distribution. Perl currently has
    very little support for uninstalling modules, which is one reason why
    it's a good idea to use your OS's package manager instead, if you can
    (unless you're lucky enough to be using BSD, when BSDPAN will take care
    of it for you... :) ).

    Ben
    Ben Morrow, Nov 7, 2007
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Mike Solomon

    DBD::mysqlPP v DBD::mysql

    Mike Solomon, Feb 16, 2004, in forum: Perl Misc
    Replies:
    1
    Views:
    214
    James Willmore
    Feb 16, 2004
  2. Hal Vaughan
    Replies:
    2
    Views:
    129
    Hal Vaughan
    Aug 27, 2004
  3. Hal Vaughan

    Problem installing DBD::MySQL 2.9004

    Hal Vaughan, Aug 29, 2004, in forum: Perl Misc
    Replies:
    2
    Views:
    223
    Hal Vaughan
    Aug 29, 2004
  4. Jim Cochrane
    Replies:
    0
    Views:
    117
    Jim Cochrane
    Aug 25, 2007
  5. Jørn Dahl-Stamnes

    Problem installing DBD::mysql

    Jørn Dahl-Stamnes, Dec 21, 2007, in forum: Perl Misc
    Replies:
    10
    Views:
    261
Loading...

Share This Page