Projects / mytop / Comments

Comments for mytop

12 May 2010 08:44 diadomraz

Here is a small patch that makes it work with MySQL5

--- mytop.old 2010-05-11 08:55:54.000000000 -0500
+++ mytop 2010-05-11 09:03:27.000000000 -0500
@@ -713,7 +713,7 @@
if ($config{header})
- my @recs = Hashes("show status");
+ my @recs = Hashes("show".(substr($db_version,0,1)>4?" global":"")." status");

## if the server died or we lost connectivity
if (not @recs)

27 Apr 2010 21:36 DAE51D

It would be great if mytop would show the:

Slave_IO_Running: Yes
Slave_SQL_Running: Yes

on slaves, so that you can quickly see if there is a problem.
We leave mytop running for DEV/TEST/PROD master/slave servers (6 windows).

29 Oct 2009 12:31 jerjones

If you use double-hyphen comments in multi-line SQL statements, then they'll also break the EXPLAIN feature when the SQL statement is converted to a single-line. To solve that, apply the following patch which translates double-hyphen comments into C-style comments using /* and */, which makes them safe within a single-line and preserves all of mytop's functionality:

> ## alter double hyphen comments so they don't break
> ## the query when newlines are removed
> $thread->{Info} =~ s~\s--(.*)$~ /* $1 */ ~mg;

23 Oct 2009 15:10 jerjones

Two minor issues with mytop are that (1) when it encounters certain multi-line SQL queries the regexes which make the queries displayable don't correctly put a space in where the newlines were, which affects display of the queries and breaks the EXPLAIN of them; and (2) that it doesn't display query cache statistics if your query cache is set to DEMAND rather than on or off. The following patch fixes both of these:

< if ($_->{Value} eq 'YES')
> if ($_->{Value} eq 'YES' or $_->{Value} eq 'DEMAND')
< $thread->{Info} =~ s/[\n\r]//g;
> $thread->{Info} =~ s/[\n\r]/ /g;

03 Oct 2009 13:57 robfico

There is a patch for mytop for the problem with displaying queries in recent versions of MySQL:

03 Jul 2009 15:36 JamesBromberger

When running against MySQL 5.4.x, it seems that the number of SQL queries is no longer stored against the "Questions" variable, but against "Queries"; this breaks the Queries and Quereies Per Second fields in MyTOP.

17 Jun 2009 20:47 robfico

With the release of MySQL 5.0.83, mytop no longer logs queries except for its own queries... It worked in 5.0.67.

08 Apr 2009 16:11 kernow9

The latest cpanel update (upcp) causes Mytop to fail:
[~]# mytop
Error in option spec: "long|!"

To work around this, edit /usr/bin/mytop
and search for "long|!" then comment out the GetOptions line "long|!" => \$config{long_nums},

11 Mar 2009 08:27 chorny

Please update it on CPAN also - it is convenient to install it with CPAN client.

22 Dec 2005 16:28 laxamar

Have a patch for Longer Ids
I modified the original mytop to dynamically adapt to longer Ids. Please let me know where to post the patch.


Project Spotlight


An open, cross-platform journaling program.


Project Spotlight


A scientific plotting package.