I’ve set up a log file to pick up MySQL slow queries.
I’ve been unable to parse the file however. Linux makes this task seem very simple. In tutorials it seems as easy as:
$ mysqldumpslow -s c -t 10
In Windows however, I’m not sure how you run Perl, located in: G:\xampp\perl\bin with the Perl Script mysqldumpslow.pl, located in: G:\xampp\mysql\scripts
I’ve tried to enter:
G:\xampp\mysql\scripts\perl mysqldumpslow -s c -t 10
The command prompt returns something like “perl is not recognized”.
Errm, you are using the wrong paths.
If perl.exe is located in G:\xampp\perl\bin and the mysql script in G:\xampp\mysql\scripts, you need:
Of course, that’s a very roundabout way of doing things, so instead, add perl to your PATH, and
cdinto the correct directory and then run it:Or even better, add perl to your known filetypes.
Options -> File Types.
plfor theextension field. Click Ok.
For Action type
open, for ‘Application used to perform action’ type:G:\xampp\perl\bin\perl.exe -w "%1" %*Click Ok.
Now you can just run the script as:
As you would in Linux.
Quick note: Adding .pl files as known file types is roughly equivalent to Unix people adding
to the start of every perl script. In Windows you only need to add it once.
Second note: The
-wturns on Warnings in the perl interpreter. You can leave out the-wif you wish.