PDA

View Full Version : Installation of DBD:Mysql not working


Debbie-Leigh
05-26-2008, 06:59 PM
Hi,

I'm trying to install the DBD:Mysql perl module, but am completely lost as to why it doesn't seem to be working.

I'm trying to install the binary version 4.007 on Windows XP and have AcivePerl 5.10.0.1002 installed and MySql version 5.0.45.

I've followed the instructions in the readme file and have typed the following into a Windows command prompt:


ppm install DBI
ppm install DBD::mysql


They both seemed to work perfectly, as the messages showed that they both downloaded the files from the activestate website, unpacked and installed them all fine.

However, when I try to use a perl application that I have used for years with no problem I get the following messages:


Perl module DBD::mysql is not installed.

All Perl modules are available free from CPAN.ORG. Root access to the server is required to install them. Contact your host for advice.

** Halted **


Could anyone tell me what I could be doing wrong that would cause the module not to work, when all the messages indicate that DBD:MySql was installed without any problems?

Debbie

FishMonger
05-27-2008, 10:04 PM
The error message that you're receiving is not being produced by perl.

"Root access to the server is required..." would indicate to me that the script is being executed on a *nix box. Most often error messages on Windows boxes would use the word "Administrator" instead of "Root".

You need to provide more info on your environment, but off hand I'd say that the server was incorrectly upgraded to 5.10 and that the %INC hash didn't get populated with the directories for the 5.10. Or, you're working with an older version of ppm that doesn't have any 5.10 repositories configured.

Debbie-Leigh
05-27-2008, 10:25 PM
Hi FishMonger,

I put my machine setup in my first post. Yes, it is a windows box.

What is the %INC hash? Is it something that should be setup on installation? I just used the Activeperl installation program that does it all.

Debbie

FishMonger
05-27-2008, 11:00 PM
First, let me correct myself. It's the @INC array, not hash. (I was working a separate CGI issue at the time, which used the %ENV hash)

Perl has a built-in @INC array that holds the list of directories that get searched when modules are loaded via a use or require statement. According to the error that you're receiving, perl is unable to locate the module that you installed via ppm, so either the module was installed outside of the @INC directories, or the installation failed.

Execute these from the command line to see if perl can find the modules
C:\>perl -MDBI -e 1

C:\>perl -MDBD::mysql -e 1
If you receive any output, then that means perl was unable to locate the module(s) and the output will include the list of directories that it searched.

Debbie-Leigh
05-28-2008, 12:11 AM
Hi FishMonger,

I've just tried the commands. The first one produced no messages. The second one produced the following:


Can't locate DBD/mysql.pm in @INC (@INC contains: D:/Web/Perl/site/lib D:/Web/Pe
rl/lib .).
BEGIN failed--compilation aborted.

But wouldn't that just mean that DBD:Mysql is not installed, which is what we already know?

Is there something else that I should have put in one or other or those two directories before I ran the install commands, instead of just running them as is?

Debbie

FishMonger
05-28-2008, 01:15 AM
The module could be installed, but not within your @INC directories. A normal/default install of Perl on a Windows box would go into C:\perl.

It's possible that the module is located on your C drive instead of your D drive. Search your drives for mysql.pm. If you find it, you can move it to its proper location on your D drive. If you don't find it, then something went wrong during the ppm installation.

You should verify that you're pointing to the proper ppm repositories and if needed, reinstall the module. It might be best to use the ppm gui instead of the command line installation. Execute the ppm command by itself without passing the install keyword. After the gui loads, you can verify the repos under Edit->Preferences. Once that is done, scroll down to DBD::mysql and install it. If it shows that it's already installed, then uninstall/reinstall. Pay close attention to the output in the Status and Details panes.

Debbie-Leigh
05-28-2008, 01:42 AM
Hi FishMonger,

The only repository showing in the preferences is the ActiveState Package Repository, which points to http://ppm4.activestate.com/MSWin32-x86/5.10/1002/package.xml

There are two areas: D:/web/perl/site and D:/web/perl. I install all my apps on my D drive for ease of recovery and Windows reinstall reasons.

The only DBD:Mysql I can see installed is called DBD-mysql-informationschema. Is that the correct one for DBD:Mysql or should there be another one?

DBI is installed, but it has a green star against it. Is that significant?

Debbie

FishMonger
05-28-2008, 02:18 AM
DBI is installed, but it has a green star against it. Is that significant?That indicates that there is a newer version available. If you want, you could and probably should upgrade it to the newer version.

You need to add more repositories. The default one pointing to activestate doesn't include the DBD::mysql module. I'm attaching 2 printscreens showing my setup.

Debbie-Leigh
05-28-2008, 10:27 PM
Hi FishMonger,

Thank you for your pointers.

I've upgraded the DBI to 1.602, added the two extra repositories and clicked the refresh button, but I still don't see the DBD:Mysql package that you have in your list. I can see the informationschema, SimpleMySql and mysqlPP, but not the basic mysql package.

Any ideas why it's not appearing even in the full list?

Debbie

FishMonger
05-28-2008, 10:37 PM
Try closing then relaunching the ppm gui. If it still doesn't show up, try installing from the command line and pass the full url to the ppd.
C:\>ppm install http://cpan.uwinnipeg.ca/PPMPackages/10xx/DBD-mysql.ppd

Debbie-Leigh
05-29-2008, 12:15 AM
Hi FishMonger,

Yes! That worked. Everything else is now working too. How weird that it didn't appear in the list, yet it is actually in the repository.

Thank you very much for your help and patience. :)

Debbie