Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical

Re: Strawberry Perl & DBD::mysql

by diakopter (Novice)
on Jan 23, 2009 at 22:08 UTC ( #738604=note: print w/ replies, xml ) Need Help??

in reply to Strawberry Perl & DBD::mysql

Yes, I've gotten it to work. Here are the steps I used:

  1. Download the file
  2. Make sure mysql.exe is in your path. Run it: perl
  3. It will generate a mysql_config.bat and file, and install them to your mysql/bin directory, hopefully. On mine, I had to edit the .bat slightly to get it to work with Strawberry - remove the "%~dp0" prefix from lines 4 and 7
  4. Run "cpan" from the Command Prompt.
  5. run the command "look DBD::mysql"
  6. edit the Makefile.PL with the edits shown at
  7. disable the server tests (if you want)
  8. perl Makefile.PL
  9. add path_to_mysql\lib\opt\libmysql.lib to the list of EXTRALIBS and LDLOADLIBS in Makefile Also, you need to make sure (it should already be) libmysql.dll is in your %PATH%. Note: since it was x64 windows mysql server bin\ that was in my %PATH%, I had to refer to the 32-bit libmysql.lib (stored in a different place), and also I had to put the 32-bit libmysql.dll in blib\arch\auto\DBD\mysql so that the tests run and it installed it correctly. That way (for me) it uses the 32-bit client .dll but operates against my 64-bit mysql server (which happens to be on localhost).
  10. dmake
  11. dmake test
  12. dmake install
Thanks to Randy Kobe and Chris Nighswonger (see

Comment on Re: Strawberry Perl & DBD::mysql
Replies are listed 'Best First'.
Re^2: Strawberry Perl & DBD::mysql
by geoffmcqueen (Initiate) on Jan 29, 2009 at 21:09 UTC
    Thanks for the great tips! Turns out I didn't need to change the .bat file to remove %~dp0, but perhaps that is a Win32 vs Win64 issue. Again, massive thankyou.
Re^2: Strawberry Perl & DBD::mysql
by Pyrrhic (Initiate) on Feb 17, 2009 at 00:56 UTC
    I badly need this patch and tried to run: has failed every time stating: 'C:\PROGRA~1\MySQL\MySQL' is not recognized as an internal or external command, operable program or batch file. Problem running C:\PROGRA~1\MySQL\MySQL Server 5.0\bin \mysqladmin.exe - aborting ... ...I went into the script and found that the variable: $mysqladmin was correctly getting the path in $mysqladmin @line 55, or thereabouts, of the script, however the next line: my $v = qx($mysqladmin version); results in no value in $v which then exits on the following "unless ($v) { etc, etc.... I attempted to run "mysqladmin version" at the command prompt which resulted in an error: "mysqladmin: connect to server at 'localhost' failed error: 'Access denied for user 'ODBC'@'localhost' (using password: NO)' ...assuming this might be why $v gets no value, I spent hours trying to figure this out and did many things to my MySQL. I can get it to work issuing this command: mysqladmin -u root -p1588 version (1588 is just a dummy password value I put in...) ...first, I may be barking up the wrong tree here! ...second, if I am not, how do I feed the correct string to this portion of the script? Any help would be very much appreciated, it took me a long time to find this thread and answers to installing DBI and DBD:mysql on my Windows Vista machine with Perl 5.10 and the latest MySQL. I badly need wisdom and thank anyone who thinks they can explain this in advance! Best Pyrrhic
      'C:\PROGRA~1\MySQL\MySQL' is not recognized as an internal or external command

      I would think that the main problem here is that mysqladmin.exe is in a folder whose name contains white space (ie the "MySQL Server 5.0" part of the path).

      The best solution is to not put *anything* in such places - then you won't have to deal with the various workarounds. One such workaround in this instance (untested) is to replace $v = qx($mysqladmin version); with $v = qx("$mysqladmin" version);
      I think that will work - otherwise you could try  $v = qx("\"$mysqladmin\"" version);

        Or use a short pathname (one without spaces)
        D:\>perl -MWin32 -e"print Win32::GetShortPathName(shift)" "C:\Program +Files\Mozilla Firefox" C:\PROGRA~1\MOZILL~1

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://738604]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (4)
As of 2016-02-06 11:58 GMT
Find Nodes?
    Voting Booth?

    How many photographs, souvenirs, artworks, trophies or other decorative objects are displayed in your home?

    Results (226 votes), past polls