Installing DBD::mysql: what a pain!
I wanted to test Bugzilla on Windows 7 using Perl 5.12.0. I first installed ActivePerl 5.12.0. Unfortunately, DBD::mysql is missing from the PPM repository. So I installed Microsoft Visual C++ 2010 express to use nmake.exe and compile DBD::mysql myself, but it keeps throwing errors:
C:\Users\buclin\Downloads\dbd-mysql>"\Program Files\Microsoft Visual Studio 10.0\VC\bin\nmake.exe"
Microsoft (R) Program Maintenance Utility Version 10.00.30319.01
Copyright (C) Microsoft Corporation. Tous droits réservés.
syntax error at -e line 1, near "’755′)"
Missing right curly or square bracket at -e line 1, at end of line
Execution of -e aborted due to compilation errors.
NMAKE : fatal error U1077: ‘C:\Perl\bin\perl.exe’ : code retour ’0xff’
Stop.
I then installed Strawberry Perl 5.12.0, which already has DBD::mysql, but now I get the following error when accessing Bugzilla from the web browser:
Software error:
install_driver(mysql) failed: Can’t load ‘C:/strawberry/perl/vendor/lib/auto/DBD/mysql/mysql.dll’ for module DBD::mysql: load_file: Le module spécifié est introuvable at C:/strawberry/perl/lib/DynaLoader.pm line 200.
at (eval 938) line 3
Compilation failed in require at (eval 938) line 3.
Perhaps a required shared library or dll isn’t installed where expected
at Bugzilla/DB.pm line 1095
I wasted several hours playing with ActivePerl, Strawberry Perl and Visual C++, with no success.
Someone, please compile DBD::mysql successfully and put it in the ActivePerl PPM repository! Thanks!
Maybe install ActivePerl 5.10.1.1007? It’s a simple "ppm install DBD::mysql" then.
I know, but my goal is to test Bugzilla against Perl 5.12. I had Perl 5.10.x for a long time (and things were indeed working nicely, including DBD::mysql).
strawberryperl 5.12 includes a precompiled DBD::mysql.
I know. That’s the one which throws the error above.
you’ll need libmysql.dll in your path, or in your auto/DBD/mysql directory.
strawberryperl was expecting this file to be libmysql_.dll, don’t know why
Hum, I copied libmySQL.dll from MySQL into auto/DBD/mysql/, but this has no effect. Why does it need this file when the one it’s complaining about, i.e. mysql.dll, is already in auto/DBD/mysql/?. Could this be a problem with my version of MySQL, 5.5.3?
For the record, and thanks to glob, the way to fix the problem with Strawberry Perl is to copy C:\strawberry\c\bin\libmysql_.dll to C:\strawberry\perl\vendor\lib\auto\DBD\mysql\libmysql_.dll. Yay!
Best to put the MySQL DLLs in Perl’s bin\MSWin32… directory, not in auto, and make sure that this is in your (Windows) PATH.
I don’t use Strawberry, but I did compile this module just fine with a MinGW Perl and it does work for me, with the DLL in Perl’s architecture specific binary folder.
Frédéric: Glad to hear you got the problem solved… I’ll make sure the file is installed copied in future versions of Strawberry Perl.
As for the question about why it’s built as libmysql_.dll – it’s so any other libmysql.dll that may be on the system does not conflict with it.
thanks for installing DBD guide.