faqts : Computers : Programming : Languages : Perl : Database Backed Sites : MySQL

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

9 of 16 people (56%) answered Yes
Recently 6 of 10 people (60%) answered Yes

Entry

Perl: Database: Module: DBD-MySql: Error: Can't locate DBI.pm in @INC: ActiveState Perl v5.8.6.811

Dec 27th, 2004 22:20
Knud van Eeden,


----------------------------------------------------------------------
--- Knud van Eeden --- 27 December 2004 - 05:26 pm -------------------

Perl: Database: Module: DBD-MySql: Error: Can't locate DBI.pm in @INC: 
ActiveState Perl v5.8.6.811


Possible solution:

 Run the command

  ppm install dbi

---
---

Steps: Overview:

 1. -Uninstall your old Perl version completely

     1. Remove old ActiveState Perl from
        'Window add/remove programs' list

     2. Delete your old Perl directory completely

 2. -Install the latest version of
     ActiveState Perl v8.6.811

 3. -Install the DBD-MySql module

     1. ppm

     2. install DBD-MySql

     3. this installs successfully

 4. -Then run e.g. a simple perl program
     like this

--- cut here: begin --------------------------------------------------

#!C:/perl/bin/perl.exe

use CGI qw(:standard);

use MySql;

--- cut here: end ----------------------------------------------------

 5. You get then the following error message
    in the newest version of Perl

--- cut here: begin --------------------------------------------------

> perl mytest.HTM

Can't locate DBI.pm in @INC (@INC contains: c:/Perl/lib 
c:/Perl/site/lib .) at c
:/Perl/site/lib/MySql.pm line 11.

Compilation failed in require at mytest.HTM line 5.

BEGIN failed--compilation aborted at mytest.HTM line 5.

--- cut here: end ----------------------------------------------------

 6. -I tried a few things

    1. Installing latest version of MySql

    2. Running

        perl -MCPAN -e "install DBI"

        perl -MCPAN -e "install DBD::MySql"

    3. Installing latest Apache
       (as I tried to run web server page)

    4. Adding to the PATH the 'MySql' server path

        SET PATH=%PATH%;<your mysql server path>

    5. Adding to the PATH

        c:\perl\lib

       and

        c:\perl\site\lib

       e.g.

        SET PATH=%PATH%;c:\perl\lib;c:\perl\site\lib

    6. I then searched again on Google, and found that
       you possibly should create an MSDOS environment variable

         PERL5LIB

       and add the Perl lib path to it

        set PERL5LIB=c:\Perl\lib;c:\Perl\site\lib"

       (you will have to adapt the file path to your computer)

    But this all gave no change.

  7. I finally decided to revert to my old version of ActiveState Perl
     v5.6.1.630 and then it immediately worked perfectly again

  8. I reported this error to

      http://www.activestate.com

  9. The solution should be to run the command

      ppm install dbi

     that worked successfully for me.

---
---

Note:

It took me several hours to find this out.

Because of I wanted to install the Microsoft SQL server DBD-Sybase on
the old Perl v5.6 version, which complained about

--- cut here: begin --------------------------------------------------

PPM interactive shell (2.1.5) - type 'help' for available commands.
PPM> install DBD-Sybase
Install package 'DBD-Sybase?' (y/N): y
Installing package 'DBD-Sybase'...

Error installing package 'DBD-Sybase': Read a PPD for 'DBD-Sybase', 
but it is
not intended for this build of Perl (MSWin32-x86-multi-thread)

PPM>

--- cut here: end ----------------------------------------------------

so I decided to download the newest version of ActiveState Perl
instead. With the result that DBD-MySql could not be installed and
used correctly anymore.

---
---

Internet: see also:

---

Perl: Database: Link: Overview: Can you give an overview of links?
http://www.faqts.com/knowledge_base/view.phtml/aid/33044/fid/654

----------------------------------------------------------------------