Trouble using package manager to install DBD::mysql

Posted by exc233_psu on 2009-01-01 10:43
Forums: PPM | OS: Windows XP Pro

Hello,

I apologize if this is already a FAQ and did try searching, but have to admit that I am not very good at/and new to using this forum and PERL.
I will start with the basic question and then provide the details of what my problem is and what I have tried to fix it below since it is a bit long.

My basic question is: Is there a version of ActivePERL where, when using the package manager, the DBD::mysql package will appear for me to install using the package manager. If not, can anyone supply me with a detailed step-by-step instruction on manual installation that I can understand (I apparently do not understand the instructions provided in the DBD::mysql tar file obtained from CPAN's website). I am currently running Komodo 3.5.3 and ActivePERL 5.8.9 Build 825 but have tried to adjust the repositories searched to 818, 819, and 822 without any success.

As another aside I have tried installing HTML::Strip manually unsuccessfully as well and would appreciate it if there is a repository with this package as well, or instructions on how to install this pm manually as well.

I have tried several things suggested on this site including re-installing various versions of ActivePERL as well as trying to manually install DBD::mysql most recently using the reciepe listed at the following site, but have had no such luck. I also tried reading the install file provided with the DBD::mysql release, but apparently don't understand what it is saying (particularly in reference as to where I need to run certain parts of the program).

Here is the background: (And yes, I realize that my own stupidity got me into this situation and appreciate anyone's help and advice in helping me out of the hole I have dug for myself).

I have been using Komodo 3.5 and ActivePERL 5.8 to try to run several programs related to extracting data from txt and html documents and then importing the data into a mysql database. I had been able to run a mysql program under the command use DBI to create the database with header information, but when I tried to run another program to extract the data from the source documents and put that data into the mysql database, the program indicated that it could not find the DBD program in the @INC file (If I understand correctly, this is where the program looks to find the pm files used and thought that I had manually installed all of the necessary pm programs from the DBD::mysql tar file obtained through CPAN into the correct folders but it is still not working). I marked the DBD::mysql program for removal using the package manager gui and removed the package believing that I would just un-install and re-install it to remove any bugs. Big mistake on my part since it is no longer appearing in the repository on the version of package manager I have been using. In the mean time I have upgraded my version of Komodo to 3.5.3 and also uninstalled and installed ActivePERL version 5.8 (original version on my computer) 5.10 and now installed 5.8.9 Build 825. After each install/uninstall I would restart the computer. I have also tried to edit the repository information in the Perl Package Manager to direct it to search repositories for 818, 819, 822 and 825 to see if I could find the DBD::Mysql file in any of those. I also attempted to add a new repository on my local hard drive where I downloaded the tar files to.

I also tried to use a recipe-502297-1.pl (I copied it below for those interested) to see if I could manually install the DBD::mysql pm files into the appropriate directories, but had no luck. Couldn't find the ppd file to use the Package Manager.

Copy of recipe-502297-1.pl

1. Installing Perl Modules on Windows

1.1 Perl Modules
A Perl module is a package (has .pm as extension) that can be reused and is defined in a library file whose name is the same as the name of the package. A module may provide following.
i) Provide a mechanism for exporting some of its symbols into the symbol table of any other package using it.
ii) It may also function as a class definition and make its operations available implicitly through method calls on the class and its objects, without explicitly exporting any symbols.
Usually Perl modules are included in a Perl program as following. To include a module ‘MyModule.pm’, write:
use MyModule;

1.2 Getting packages

The first thing that you will need to do is to get the package for module. Usually zipn files are available for packages. Below are the steps for getting the zip file.
i) Go to http://ppm.activestate.com
ii) Go to ‘Zips’ tab.
iii) Click on one of ActivePerl5xx, ActivePerl6xx, or ActivePerl8xx links based on the build version of Active Perl in your Windows machine. You can go to Start->Settings->Control Panel->Add Remove Programs to find ActivePerl build 5xx, 6xx or 8xx in the list.
iv) Click on Windows link.
v) Download the zip file you need (for example: Math-Stat.zip) into your local Windows machine in a temp folder (say C:/Test/).
vi) Similarly download any other zip files that you need to install.

1.3 Installing modules using PPM tool.

The ppm program is the package manager for ActivePerl. It simplifies the task of locating, installing, upgrading and removing Perl packages. PPM is installed automatically with ActivePerl.
All PPM operations and configuration can be performed at the command line. You can use 'ppm help' command in command prompt for more information.
After downloading zip files for the packages (as discussed in 1.2), you can follow below steps to use these zip files, for installing modules using PPM tool.
1. Unzip the package to a temporary directory (say C:/Test/).
2. Go to command promots and install the package by specifying the name of ppd file directly:
ppm install C:\Test\Modulename.ppd
If the module installation is successful, you will see ‘Successfully installed…’ message on the command prompt.

After installing Math-Stat module, you can include the same in Perl file like following.

use Math::Stat;

1.4 Installing modules manually

Unfortunately, not all modules can be installed via PPM. Also, many times you may not be able to use PPM tool to install modules, because of you being under-privileged user in Windows machine. In all such cases, if you need to install a module, you should be able to install it manually, as discussed below. After downloading zip files for the packages (as discussed in 1.2), you can use following steps.
i) Unzip the package to a temporary directory (say C:/Test/).

ii) This will give .ppd file, a readme file and a folder (say, MSWin32-x86-multi-thread-5.8 for Math-Stat module). Ignore .ppd and readme files, then check the content inside this folder. If there is zip or tar file inside, then unzip it.

iii) Look for .pm file inside the subfolders (here you will find Stat.pm in blib\lib\Math\ folder.
If ActivePerl is installed in C:/Perl/ folder in your Windows machine, then put this .pm file into C:/Perl/site/lib/Math/ folder (If this Math folder does not exist, then crate one here). Please note correspondence between the common portion of path (\lib\Math\) here. This needs to be maintained when placing the .pm file.

iv) Look for .html file inside the subfolders again (here you will find Stat.html in blib\html\site\lib\Math\ folder). This file is a help file describing the functions available in corresponding .pm file). It is not mandatory to copy this file, however if you wish to copy, you can copy this into C:\Perl\html\site\lib\Math\ folder (If this Math folder does not exist, then crate one here) in your Windows machine.

v) Look for autosplit.ix file inside the subfolders again (here you will find this file in blib\lib\auto\Math\Stat\ location). then there Put this file in C:/Perl/site/lib/auto/Math/Stat/ folder (If this Math folder does not exist, then crate one here).

Please note that every package may not have autosplit.ix file. In other words, autosplit.ix file may not be available for every package. If it is not available there, then there is no need to put it.

vi) Now, open C:/Perl/site/lib/auto/Math/.packlist file (If this Math folder does not exist, then crate one here) and make an entry corresponding to the .pm file. For example, the entry will be like this in .packlist file.

vii) Repeat steps (iii) to (vi) for each of the .pm file present in the zip file for the package.

Is there something that could be missing from the Komodo program and that is why I am incurring the error?

I have also copied the error code I am receiving below. Please let me know if you need any more information.

install_driver(mysql) failed: Can't locate loadable object for module DBD::mysql in @INC (@INC contains: C:/Perl/site/lib C:/Perl/lib .) at (eval 6) line 3
Compilation failed in require at (eval 6) line 3.
Perhaps a module that DBD::mysql requires hasn't been fully installed
at C:\Documents and Settings\Christine\My Documents\Edgar\DEF 14A\CDA extract.pl line 25

Thank you all again very much for your help. Again, sorry if this is already somewhere else and would appreciate being pointed in the right direction.

Sincerely,

Christine Cheng

grahams
ActiveState Staff
Wed, 2009-01-07 15:20

Randy Kobes' 5.8 repo at the University of Winnipeg has both the modules you are looking for:
http://theoryx5.uwinnipeg.ca/ppms/

exc233_psu | Thu, 2009-01-08 06:01

Thank you very much. This worked perfectly.