On Windows, you should do the following to install the MySQL
DBD
module with ActiveState Perl:
Get ActiveState Perl from http://www.activestate.com/Products/ActivePerl/ and install it.
Open a console window (a “DOS window”).
If necessary, set the HTTP_proxy
variable. For example, you might try a setting like this:
set HTTP_proxy=my.proxy.com:3128
Start the PPM program:
C:\> C:\perl\bin\ppm.pl
If you have not previously done so, install
DBI
:
ppm> install DBI
If this succeeds, run the following command:
ppm> install DBD-mysql
This procedure should work with ActiveState Perl 5.6 or newer.
If you cannot get the procedure to work, you should install the MyODBC driver instead and connect to the MySQL server through ODBC:
use DBI; $dbh= DBI->connect("DBI:ODBC:$dsn",$user,$password) || die "Got error $DBI::errstr when connecting to $dsn\n";
User Comments
The new version of ActivePerl ActivePerl-5.8.0.804-MSWin32-x86 requires you to recompile the DBD::mysql driver manually. The older PPM file on CPAN, WILL NOT WORK.
I never could resolve this problem in Perl 5.8. I have read around the internet that Perl 5.6 and Perl 5.8 are binary incompatible so libraries must be recompiled. However, every 5.8 version of DBD I could find did not work so I had to go back to Perl 5.6 and follow the instructions above to use DBD again.
http://search.cpan.org/src/JWIED/DBD-mysql-2.1024/README:
As of this writing, the above procedure won't work with ActivePerl 5.8.0, because so far a PPM for DBD::mysql is not available from the ActiveState server. I don't know why. However, Randy Kobes has kindly donated a PPM package
to his own repository. You can use this as follows:
ppm install http://theoryx5.uwinnipeg.ca/ppms/DBD-mysql.ppd
works perfectly for me with ActiveState Perl Version 5.8
I was unable to connect with the ftp server, however i found the ppd here:
http://www.cpan.org/authors/id/JWIED/DBD-mysql-1.2212.x86.ppd
i used ppm2 to install, ppm3 failed all attempts.
Using the Perl Package Manager, I was able to install DBD from the link that is given above and everything is working fine.
Many thanks to the author of the module.
And if you missed it above. Use install in ppm with the folowing URL as the first arguement.
http://theoryx5.uwinnipeg.ca/ppms/DBD-mysql.ppd
A better choice to ActiveState Perl, is your own build of Perl 5.8+
Instructions on building Perl 5.8 (and above) for Windows NT/2000/XP
http://www.devside.net/guides/windows/perl
I too was missing DBI after installation of 5.8.0 in Windows. I discovered that the above instructions were in error. First, the command should be c:\perl\ppm.bat, that gets the package manager working. Next, if you are like me and developing on an intrAnet server from a workstation and the net is not connected to your server, then go to http://ppm.activestate.com/PPMPackages/zips/8xx-builds-only/Windows/, locate DBI-1.37.ZIP, download it, extract the files to a temp directory. Then using the repository command, add the full path to the temp directory, turn off the others, and run ppm> Install dbi. Mine installed like a charm.
I couldn't make it work. But after downloading http://ppm.activestate.com/PPMPackages/zips/8xx-builds-only/Windows/DBD-mysql-2.9002.zip I unpacked and made as the readme file says and everything went fine.
I tried pass a complete journey try to make works MySQL 4.1.4 and ActivePerl 5.8 on windows... dbi and dbd was installed fine but i was always getting a error message saying to update my client... so i try to recompile new version of dbd try to set mysql password to old format and so on...
i try it with Active Perl 5.6... still didn't work
so i downgrade mySQL to 4.0.2 and it works!
now i have
mySQL to 4.0.2
Active Perl 5.6
and dbi, dbd from ppm
on win2k
now will go on bugzilla!
...
Active Perl 5.6 don't work on bugzilla use 5.8 and take the package at http://glob.com.au/ppm/
I don't believe I can possibly be the first person to try this, I'm only adding this here for other's benefit hitting a similar problem and finding this link.
I wanted - sorry WANT - to install mod_perl (on my Windows XP pc), ppm install seemed to be telling me I needed a newer version of perl (can't remember exact text now it all seems so long ago).
Installed perl 5.8.4 binary build 810 (the latest version as of 25Sep04, download dated Jun04) and to my absolute horror found it had wiped out my installed packages, DBD-mysql being one of them.
Trying to install dbdmysql went like this...
ppm> install http://theoryx5.uwinnipeg.ca/ppms/DBD-mysql.ppd
Error: no suitable implementation found for 'DBI'.
ppm> install DBI
Error: no suitable installation target found for package DBI.
ppm> install ftp://ftp.de.uu.net/pub/CPAN/authors/id/JWIED/DBD-mysql-1.2212.x86.ppd
Error: no suitable installation target found for package DBD-mysql.
I have what appears to be the latest version of DBI - 1.37, and anyway that must be the DBI that shipped with perl 5.8 'cos I've just downloaded and installed it.
In summary I've no answers for you but maybe just maybe someone else will post the answer(s).
Using ActivePerl 5.8.4.810 and WinXP.
ppm> install DBI
ppm> install DBD-MySQL
Worked like a charm.
Shane Curveon on February 12 2003 advice
ppm> install "http://theoryx5.uwinnipeg.ca/ppms/DBD-mysql.ppd" "DBD::mysql"
worked for me
and only when the URL was inserted before "DBD::mysql" as above
thanks Shane
rudy spangler
The DBD-mysql from
ppm install http://theoryx5.uwinnipeg.ca/ppms/DBD-mysql.ppd
...worked for me.
With this version, if you are getting the upgrade client error, then it is probably an issue with the change in password hashing.
See http://dev.mysql.com/doc/mysql/en/Old_client.html
I followed the instructions which didn't work for me either. I did make it work with the ActivePerl-5.8.6.811-MSWin32-x86-122208.msi on Windows 2000, doing the following:
I installed ActivePerl to my 'F:\' drive;
F:\Perl\bin>ppm
PPM - Programmer's Package Manager version 3.1.
Copyright (c) 2001 ActiveState Corp. All Rights Reserved.
ActiveState is a devision of Sophos.
Entering interactive shell. Using Term::ReadLine::Stub as readline library.
Type 'help' to get started.
ppm> install DBI
====================
Install 'DBI' version 1.47 in ActivePerl 5.8.6.811.
====================
Downloaded 546500 bytes.
Extracting 73/73: blib/arch/auto/DBI/Driver_xst.h
Installing F:\Perl\site\lib\auto\DBI\dbd_xsh.h
and a bunch of other files.
I then downloaded from here:
http://ppm.activestate.com/PPMPackages/zips/8xx-builds-only/Windows/DBD-mysql-2.9002.zip
I extracted the 3 files contained in the package to 'F:\Perl\dbd_mysql'
then extracted the zip file contained within it to the same folder. I then ran from the ppm> prompt:
ppm> install F:\Perl\dbd_mysql\DBD-mysql.ppd
====================
Install 'DBD-mysql' version 2.9002 in ActivePerl 5.8.6.811.
====================
Downloaded 178803 bytes.
Extracting 17/17: blib/arch/auto/DBD/mysql/mysql.lib
Installing F:\Perl\site\lib\auto\DBD\mysql\mysql.bs
and a bunch of other files......
until
Successfully installed DBD-mysql version 2.9002 in ActivePerl 5.8.6.811.
The process seemed almost painless for me. I did as follows on WinXP Pro SP2 (ActivePerl 5.8.7.813)
ppm> install DBI
... snip ... (success)
ppm> search DBD-mysql
Searching in Active Repositories
1. DBD-mysql [3.0002] A MySQL driver for the Perl5 Database Inter~
2. DBD-mysql-SimpleMyS~ [0.5]
3. DBD-mysql-SimpleMyS~ [0.5] (none)
4. DBD-mysqlPP [0.04] Pure Perl MySQL driver for the DBI
ppm> install DBD-mysql
====================
Install 'DBD-mysql' version 3.0002 in ActivePerl 5.8.7.813.
====================
Downloaded 610245 bytes.
...snip... (installing, extracting etc.)
Successfully installed DBD-mysql version 3.0002 in ActivePerl 5.8.7.813.
I found that for XP I have to set the proxy as HTTP_proxy="<url><port>" in quotes!
Bye
As for having to put quotes around the environment variable...I had to do the same thing on Windows 2000.
Using ActivePerl 5.8.4.816 and WinXP.
...\perl\bin\ppm.bat
ppm> install DBI
ppm> install DBD-MySQL
Also worked like a charm.
The approach in [name withheld]'s post on March 18 2006 10:14am worked for me too!!
>> Using ActivePerl 5.8.4.816 and WinXP.
>>...\perl\bin\ppm.bat
>>ppm> install DBI
>>ppm> install DBD-MySQL
About DBI and DBD and Perl:
I do'nt know what you people are talking about ! ( As on Dt: Sep 6, 2007 ):
What I did, was this.
1) cd c:\perl\bin
c:\perl\bin> perl -v
2) I got follow. message:
This is perl, v5.6.1 built for MSWin32-x86-multi-thread
(with 1 registered patch, see perl -V for more detail)
Copyright 1987-2001, Larry Wall
Binary build 638 provided by ActiveState Corp. http://www.ActiveState.com
ActiveState is a division of Sophos.
Built Apr 13 2004 19:24:21
3) Then I use this command:
c:\perl\bin> ppm
4)
ppm> install DBD My-SQL
ppm> Install package 'DBD-MySQL?' (y/N): y
5) Then the message appered :
Installing package 'DBD-MySQL'...
Downloading http://ppm.activestate.com/PPMPackages/5.6/MSWin32-x86-multi-thread/
DBI-1.48.tar.gz ...
etc etc:
6) Then I quit from PPM>
7) That's all ! DBI is working fine !
Note: Same appraoch worked for my ActivePerl 5.8.6.811 version.
My OS is Win 2000 and NOTE that I have NOT used the command " install DBI "
Here's my take, hope it's useful to somebody - I'm really new to developing but wanted to try out perl with MySQl. I already had a WAMP package installed so found my way to this page via google (after trying the page that lists DBI and DBD-MySQL, all of which i found really confusing:)
On this page I followed this link http://www.activestate.com/Products/ActivePerl/ and downloaded the free standard version. Needless to say it was a zipped file which i unzipped to a new folder I created on my C: drive.
In that folder was a file called Installer.bat. I double clicked the file and the package installed via the command prompt window (got asked a series of questions:), nevertheless it installed - phew!!
I then followed Nish's instructions to check the version and change directories and execute the command:
c:\perl\bin>ppm
a lovely GUI opened! and I was able to see what packages were installed and what were not. DBI was already installed (no work for me there) DBD-MySQl was not so I simply highlighted the package I wanted to install and the ppm downloaded the file for me. All that was left to do was to use the icon in the ppm (marked 'run') and - hey presto - DBD MySQL was installed for me - genius - :)
Now I can start figuring where is the best place to learn how to write perl code to work with MySQL and trying it out on my machine.
This worked on windows xp with sp2
For ActivePerl 5.10.0 Build 1002 use:
ppm install http://cpan.uwinnipeg.ca/PPMPackages/10xx/DBD-mysql.ppd
On PPM GUI over activeperl 5.10 you have to follow this steps to obtain DBD-mysql
1. On the PPM GUI press Ctrl+P
2. There is a tab named suggested, you have to select uwinnipeg and press add and then ok.
3. It will add more packages to your activeperl.
4. Now you can find DBD-mysql on the search bar in the main window of the PPM.
Add your own comment.