Hi I'm logging slow queries because we're having some performance
issues and I have read about mysqldumpslow
and thought that would be a good
way to sort through the queries.
At the command prompt, I type mysqldumpslow
and I get this:
'mysqldumpslow' is not recognized as an internal or external command, operable program or batch file.
I'm using MySQL version 5.0.79 on Windows Vista.
Note:
c:\Program Files\MySQL\MySQL Server 5.0\bin
is my path and I have searched the drive for 'mysqldumpslow' and can not find it.
What am I doing wrong?
Note:
MySql 5.0.x does support the mysqldumpslow
command follow this link to manual
mysqldumpslow is a tool to examine the slow query log. It parses the slow query log files, printing a summary result. Normally, mysqldumpslow groups queries that are similar except for the particular values of number and string data values. It “abstracts” these values to N and ´S´ when displaying summary output.
To use this feature, you run pt-query-digest with the --review option. It will store the fingerprints and other information into the table you specify. Next time you run it with the same option, it will do the following: It won't show you queries you've already reviewed.
The minimum and default values of long_query_time are 0 and 10, respectively. The value can be specified to a resolution of microseconds. For logging to a file, times are written including the microseconds part.
The slow query log consists of SQL statements that take more than long_query_time seconds to execute and require at least min_examined_row_limit rows to be examined. The slow query log can be used to find queries that take a long time to execute and are therefore candidates for optimization.
edit : oops, I read the manual wrong, and gave wrong information :-( sorry :-( let's give it another try...
I've just installed MySQL on windows, to try using mysqldumpslow
, and I don't have mysqldumpslow
installed either :-( So, you are not alone, and it doesn't seem to be a problem with your install (I've tried 5.1.x, but as you highlighted, it should be the same for 5.0.x)
Looking at the "mysqldumpslow
" I have under Linux, it appears it is a Perl script ; and Perl is not often installed on a Windows machine. Maybe that would be a hint to a solution...
Well, after a bit more testing, when installing MySQL, it seems you have to select "Developpers Components > Scripts, examples", which is not installed by default (at least on windows) -- no need to reinstall everything : you can "modify" the installation, to add this option.
Then, you will have a "script" directory next to the "bin" one. For instance, on your install, it should be something like "c:\Program Files\MySQL\MySQL Server 5.0\scripts".
In this directory, there are some scripts ; one of them is mysqldumpslow.pl ; which is what you are looking for ;-)
Now, you "just" have to get Perl installed and running on your machine (sorry, I've never installed Perl on windows ; but you can find some informations here)
Hope this helps better than what I posted before !
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With