How do I fix "perl is not recognized" on Windows? -
I have set up a log file to take mySQL slow queries.
I went though though Linux makes it unable to parse the file. This task looks very simple. It seems easy in the tutorial:
$ mysqldumpslow -sc -t 10
However, I'm not sure how you run Perl, located in: G: \ xampp \ perl \ bin with Perl script Mysqldumpslow.pl , located in: G: \ xampp \ mysql \ scripts
I have tried to log in:
G: \ xampp \ mysql \ scripts \ perl mysqldumpslow -sc -t 10
command line Rompt some features such as "Pearl is not valid".
Error, you're using the wrong path.
If perl.exe is located in G: \ xampp \ perl \ bin and mysql script: live in \ xampp \ mysql \ script, you should:
> ; G: \ xampp \ perl \ bin \ perl g: \ xampp \ mysql \ scripts \ mysqldumpslow.pl -sc -t 10.
Of course, this is a very intersection of ways Therefore, instead, add Pearl, and cd
to your path and then run it:
& gt; Pat = g Set: \ xampp \ perl \ bin \;% PATH% // Note: This can be added to the // system control panel & gt; CD / DG: \ xampp \ mysql \ scripts & gt; Perl mysqldumpslow.pl -s c -t 10
Or better, add Perl to your known file types.
- Go to Explorer -> Tools -> Folder Options -> File Type.
- Type 'new' for the extension field, click
pl
OK. - Find PL in your list, under Advanced Click Action, click on 'New'.
-
For the action type
open
, 'the application used to act' type:g: \ xampp \ Perl \ bin \ perl.exe -w "% 1"% *
-
Click OK.
Now you can just run the script like this:
& gt; Mysqldumpslow.pl -sc -t 10
As you would in linux.
Quick Note: Adding .pl files as known file types is almost equivalent to Unix people
> # to start each Perl script! / Usr / bin / perl -w
In Windows you have to add it only once.
The second note: -w
turns warnings in the Pearl Interpreter if you wish to leave -w
.
Comments
Post a Comment