install_driver(mysql) failed: Can't locate DBD/mysql.pm in @INC

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • peterv6
    New Member
    • May 2007
    • 8

    #1

    install_driver(mysql) failed: Can't locate DBD/mysql.pm in @INC

    I'm running OS X Snow Leopard on a MacBook Pro. I've installed Mysql using Macports. MySQL works fine, but I need to install the DBI module. I've tried several ways, but I always get the following error:

    Code:
    install_driver(mysql) failed: Can't locate DBD/mysql.pm in @INC (@INC contains: /Library/Perl/Updates/5.10.0 /System/Library/Perl/5.10.0/darwin-thread-multi-2level /System/Library/Perl/5.10.0 /Library/Perl/5.10.0/darwin-thread-multi-2level /Library/Perl/5.10.0 /Network/Library/Perl/5.10.0/darwin-thread-multi-2level /Network/Library/Perl/5.10.0 /Network/Library/Perl /System/Library/Perl/Extras/5.10.0/darwin-thread-multi-2level /System/Library/Perl/Extras/5.10.0 .) at (eval 3) 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.
     at /Users/peterv/Perl1/db.pl line 7
    What I'd like to know is how to display what @INC contains, and how to set it to the correct values. I've searched everywhere I could think of and have found nothing. One guy suggested that @INC is a path (seems reasonable) that's not pointing to where the DBD/mysql.pm is. I really need to fix this, so any help debugging this will be really appreciated!
  • numberwhun
    Recognized Expert Moderator Specialist
    • May 2007
    • 3467

    #2
    Did you try writing some code that uses DBI? Last time I checked, DBI was a core module that was distributed with Perl. You should not have to install it.

    @INC is the Perl specific path variable that contains a list of the path's that Perl looks for modules. This is set at installation/compilation and cannot be changed.

    Regards,

    Jeff

    Comment

    • peterv6
      New Member
      • May 2007
      • 8

      #3
      Jeff,
      Yes I did write a simple script using DBI, and it failed. I don't remember what the original error message was, since I've been installing & uninstalling things all weekend trying to get the thing to work. Currently, this is the error message I get:
      Code:
      peterv@MBP17.local<502>$: db.pl
      install_driver(mysql) failed: Can't locate loadable object for module DBD::mysql in @INC (@INC contains: /opt/local/lib/perl5/site_perl/5.10.1/darwin-multi-2level /opt/local/lib/perl5/site_perl/5.10.1 /opt/local/lib/perl5/site_perl/5.8.9 /opt/local/lib/perl5/site_perl /opt/local/lib/perl5/vendor_perl/5.10.1/darwin-multi-2level /opt/local/lib/perl5/vendor_perl/5.10.1 /opt/local/lib/perl5/vendor_perl /opt/local/lib/perl5/5.10.1/darwin-multi-2level /opt/local/lib/perl5/5.10.1 .) at (eval 3) line 3
      Compilation failed in require at (eval 3) line 3.
      Perhaps a module that DBD::mysql requires hasn't been fully installed
       at /Users/peterv/Perl1/db.pl line 8
      
      Mon Apr 19 08:32:26 EDT 2010
      I installed the DBD module manually, according to the directions from CPAN, and, unfortunately, the Makefile.PL script they provide for installation has errors in it. I'm currently trying to debug that. I'm probably going to need help with it though, as I'm a novice perl programmer.

      Comment

      • peterv6
        New Member
        • May 2007
        • 8

        #4
        Makefile.PL output - what's wrong here?

        Can anyone help me debug this output? I've followed all the installation instructions to the letter, and I'm still getting this error:
        Code:
        peterv@MBP17.local<506>$: sudo Perl Makefile.PL | tee makefile.log
        tee: makefile.log: Permission denied
        
        
        PLEASE NOTE:
        
        For 'make test' to run properly, you must ensure that the 
        database user 'root' can connect to your MySQL server 
        and has the proper privileges that these tests require such 
        as 'drop table', 'create table', 'drop procedure', 'create procedure'
        as well as others. 
        
        mysql> grant all privileges on test.* to 'root'@'localhost' identified by 's3kr1t';
        
        You can also optionally set the user to run 'make test' with:
        
        perl Makefile.pl --testuser=username
        
        Use of uninitialized value in printf at Makefile.PL line 175, <PIPE> line 102.
        I will use the following settings for compiling and testing:
        
          cflags        (mysql_config) = -I/opt/local/mysql/include  -g -Os -arch x86_64 -fno-common   -D_P1003_1B_VISIBLE -DSIGNAL_WITH_VIO_CLOSE -DSIGNALS_DONT_BREAK_READ -DIGNORE_SIGHUP_SIGQUIT  -DDONT_DECLARE_CXA_PURE_VIRTUAL
          embedded      (mysql_config) = 
          libs          (mysql_config) = -L/opt/local/mysql/lib -lmysqlclient -lz -lm     -lmygcc
          mysql_config  (guessed     ) = mysql_config
          nocatchstderr (default     ) = 0
          nofoundrows   (default     ) = 0
          ssl           (guessed     ) = 0
          testdb        (default     ) = test
          testhost      (default     ) = 
          testpassword  (default     ) = 
          testsocket    (default     ) = 
          testuser      (            ) = root
        
        To change these settings, see 'perl Makefile.PL --help' and
        'perldoc INSTALL'.
        
        Multiple copies of Driver.xst found in: /Library/Perl/5.10.0/darwin-thread-multi-2level/auto/DBI/ /System/Library/Perl/Extras/5.10.0/darwin-thread-multi-2level/auto/DBI/ at Makefile.PL line 748
        Using DBI 1.608 (for perl 5.010000 on darwin-thread-multi-2level) installed in /Library/Perl/5.10.0/darwin-thread-multi-2level/auto/DBI/
        Writing Makefile for DBD::mysql
        
        Mon Apr 19 09:43:29 EDT 2010 
        /Library/Perl/DBD-mysql-4.011 ->
        peterv@MBP17.local<507>$: db.pl
        install_driver(mysql) failed: Can't locate loadable object for module DBD::mysql in @INC (@INC contains: /opt/local/lib/perl5/site_perl/5.10.1/darwin-multi-2level /opt/local/lib/perl5/site_perl/5.10.1 /opt/local/lib/perl5/site_perl/5.8.9 /opt/local/lib/perl5/site_perl /opt/local/lib/perl5/vendor_perl/5.10.1/darwin-multi-2level /opt/local/lib/perl5/vendor_perl/5.10.1 /opt/local/lib/perl5/vendor_perl /opt/local/lib/perl5/5.10.1/darwin-multi-2level /opt/local/lib/perl5/5.10.1 .) at (eval 3) line 3
        Compilation failed in require at (eval 3) line 3.
        Perhaps a module that DBD::mysql requires hasn't been fully installed
         at /Users/peterv/Perl1/db.pl line 8
        
        Mon Apr 19 09:43:29 EDT 2010
        Is there some better way to install this DBD module? is there ANY way to successfully install this thing? PLEASE I need help!

        Comment

        • peterv6
          New Member
          • May 2007
          • 8

          #5
          Originally posted by numberwhun
          Did you try writing some code that uses DBI? Last time I checked, DBI was a core module that was distributed with Perl. You should not have to install it.

          @INC is the Perl specific path variable that contains a list of the path's that Perl looks for modules. This is set at installation/compilation and cannot be changed.

          Regards,

          Jeff
          Jeff, I'm still having massive problems with this. No matter how I install the DBI module, it's never in the @INC path. You said that that path is set upon installation. Is it set in the Perl installation? If so, would uninstalling Perl and resinstalling it reset it? Also, what's the best way to remove perl from OS X? If all else fails, I'm about ready to do a clean reinstall of OS X and start from scratch.

          Comment

          Working...