Re: Strawberry Perl & DBD::mysql
by diakopter (Novice) on Jan 23, 2009 at 22:08 UTC
|
Yes, I've gotten it to work. Here are the steps I used:
- Download the file http://www.cpan.org/authors/id/R/RK/RKOBES/mysql_config_win32.pl
- Make sure mysql.exe is in your path. Run it: perl mysql_config_win32.pl
- It will generate a mysql_config.bat and mysql_config.pl 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
- Run "cpan" from the Command Prompt.
- run the command "look DBD::mysql"
- edit the Makefile.PL with the edits shown at http://strawberry.pastebin.com/f17b6dba9
- disable the server tests (if you want)
- perl Makefile.PL
- 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).
- dmake
- dmake test
- dmake install
Thanks to Randy Kobe and Chris Nighswonger (see http://wiki.koha.org/doku.php?id=en:installation:win32:koha_3_win32_installer_project) | [reply] |
|
|
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.
| [reply] |
|
|
I badly need this patch and tried to run:
mysql_config_win32.pl
...it 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
| [reply] |
|
|
'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);
Cheers, Rob
| [reply] [d/l] [select] |
|
|
Re: Strawberry Perl & DBD::mysql
by Anonymous Monk on Jan 22, 2009 at 08:02 UTC
|
| [reply] |
Re: Strawberry Perl & DBD::mysql
by Anonymous Monk on Jun 13, 2009 at 23:58 UTC
|
I just submitted a patch at rt://46926 that includes everything in the previously mentioned directions, plus a few things that were omitted.
After extracting the distribution and applying it, run the Makefile.PL and everything should be copacetic. | [reply] |
Re: Strawberry Perl & DBD::mysql
by Anonymous Monk on Jan 22, 2009 at 13:50 UTC
|
"I'm currently trying to get DBD::mysql installed for Strawberry Perl, and not having much success."
All the more reason to use the right tool -- Linux.
"Friends don't let friends use Windows." | [reply] |
|
|
Sometimes using linux isn't a option...
| [reply] |
Re: Strawberry Perl & DBD::mysql
by Anonymous Monk on Feb 24, 2009 at 22:46 UTC
|
I am but a new monk, so forgive me if I speak nonsense.
I was having the same issue and I solved it by using ppm, in what ended up being a delightfully simple end to a drawn-out battle. | [reply] |