Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where do I find the MysqlDumpSlow command?

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

like image 257
Charles Faiga Avatar asked Jul 19 '09 10:07

Charles Faiga


People also ask

What is Mysqldumpslow?

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.

How do I use PT-query-digest?

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.

What is Long_query_time in MySQL?

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.

What is MySQL slow query log?

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.


1 Answers

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 !

like image 153
Pascal MARTIN Avatar answered Oct 11 '22 14:10

Pascal MARTIN