Many users had problems while trying to install MySQL module on Perl (for me, the problem was with 64-bit Windows ).. Here I’ve listed several solutions and one of them might help you.
P.S. Before you continue reading, you might look through the article – why I preferred StrawberryPerl over ActivePerl.
Step 1: Choose Perl version
A) Using StrawberryPerl (Or similarly for DwimPerl)
Using these programs, it is very easy to intall MySQL, because they contain it (as opposed to ActivePerl, which needs additional installation from Repository).
- Firstly, you should ensure to change
perl\bin\perl.exe
path in your applications to your current path, i.e.:strawberry\perl\bin\perl.exe
- Now, in
C:/Strawberry/perl/bin/
open cpan batch file and after it opens, type:install "DBD::mysql"
(orcpan -fi "DBD::mysql"
) [p.s. if you are unable to directly open cpan, then open it from CMD]
and it should install without problems (in case you will see some minor errors, that should be a real problem, in overall MYSQL will be installed correctly… - Restart Local-server after installation.
B) Using ACTIVEPERL:
(If using the latest version and you will fail to install, then you might need the business edition, to use downgrade versions i.e. ActivePerl 5.10, because people say, that with older version it might work)
- Open
PERL/BIN/PPM
… And in the search-bar, search for DBD-mysql module… But you may cant find that, because, by default, ActivePerl doesnt contain “DBD-mysql“(at the moment:2015.04.22), then you need to add them manually. So, if you cant find there, then you might have to add the repositories at first, where DBD-mysql will exist.
(for the paragraph, thanks to TheGeekStuff )
Step 2: Add DBD-MySQL repository manually
(P.S. Skip this step, if DBD-mysql is already in your PPM list.)
You can do this step within PPM GUI too: Options>Repositories, but it could be better from command line.
Try one of these commands (change “ZZZZ” symbols to your version, for example, there should be written: 14xx or 20xx)
ppm repo add Trouchelle1 http://trouchelle.com/ppm/package.lst
or
ppm repo add Bribes1 http://www.bribes.org/perl/ppm/package.lst
or
ppm repo add Theoryx1 http://cpan.uwinnipeg.ca/PPMPackages/ZZxx/
or
ppm repo add Theoryx2 http://theoryx5.uwinnipeg.ca/ppms/package.lst
(For old version of Perl, : see this codes )
Step 3: Installing Package
-open PERL\BIN\PPM.bat
and type: cpan
(or open directly PERL\BIN\CPAN.bat
if available)
-Then inside the terminal, type:
install "DBD::mysql"
That should be enough!
(In case of problems)
For some people, this DBD::mysql
module may show some errors during installation (maybe incorrect mysql version is installed/updated… I dont know).
Then type any of these command:
ppm install DBD-mysql
OR
ppm install DBD::mysql
OR
cpan -fi DBD::mysql
OR
cpan DBD::mysql
p.s. most packages exist here too, but check your PC/Perl versions:
http://www.bribes.org/perl/ppm/
http://search.cpan.org/~capttofu/DBD-mysql-4.031/lib/DBD/mysql/INSTALL.pod
(on the right side, click download)
Then, if you can find in internet, a correct .ppd file of DBD-mysql, you can install it directly:
ppm install http://theoryx5.uwinnipeg.ca/ppmpackages/package.ppd
If the above methods wont help, this may help too:
– Install Modes manually(and click “NEXT PAGE” to see download packages..)
– https://www.bugzilla.org/docs/2.22/html/modules-manual-instructions.html )
– http://forums.movabletype.org/2009/03/installation-problem-with-dbdmysql.html
– http://lists.mysql.com/perl/4304