Projects / mytop


mytop is a Perl program which allows you to monitor MySQL servers by viewing active threads, queries and overall server performance numbers.

Operating Systems

Recent releases

  •  21 Feb 2007 13:06

    Release Notes: Support for passwords with embedded spaces was added.

    •  04 Aug 2003 17:51

      Release Notes: A revamped display, password hiding, better query cache stats, and various bugfixes.

      •  29 Oct 2002 09:54

        Release Notes: Various bugs were fixed, and query cache stats from MySQL 4.x were added.

        •  29 Apr 2002 04:58

          Release Notes: Fixed various display bugs, added new sorting and filtering options, enhanced the real-time statistics, and added the ability to EXPLAIN a query.

          •  08 Jul 2001 05:53

            Release Notes: Added a Queries Per Second (qps) mode for displaying the number of queries executed each second, in real time. It is now packed as a "normal" Perl package for the first time.

            Recent comments

            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:


            Project Spotlight


            A Fluent OpenStack client API for Java.


            Project Spotlight

            TurnKey TWiki Appliance

            A TWiki appliance that is easy to use and lightweight.