7

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

David Ferenczy Rogožan
  • 23,966
  • 9
  • 79
  • 68
Charles Faiga
  • 11,665
  • 25
  • 102
  • 139

3 Answers3

7

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 !

Pascal MARTIN
  • 395,085
  • 80
  • 655
  • 663
3

try typing

whereis mysqldumpslow

If that still says its not installed,

EDIT: Above is not relevant, as on windows. Missed that, thanks to commenter for pointing it out.

I always use mysqlsla (mysql slow log analyser) ahead of mysqldumpslow - you could give that a go.

http://hackmysql.com/mysqlsla

benlumley
  • 11,370
  • 2
  • 40
  • 39
0

Mysqldumpslow is a Perl script so under Windows you will need to make sure you have Perl installed and will need to explicitly invoke it via Perl.

The way the script is set up it will work automatically under Unix because Unix has the ability to run scripts directly by identifying the correct script processor from the first line of the script. Of course you still need Perl installed, but that is taken for granted in most Unix installations.

Or you can also try to set the path in Windows environment variables.

Irshad Khan
  • 5,670
  • 2
  • 44
  • 39