mytop
displays MySQL server activity in real-time, similar to top for processes
TLDR
Monitor MySQL queries
SYNOPSIS
mytop [-u user] [-p pass] [-h host] [-d database] [options]
DESCRIPTION
mytop displays MySQL server activity in real-time, similar to top for processes. It shows running queries, connections, and server statistics.
The display includes query threads with their states, execution times, and SQL text. Long-running queries stand out for attention.
Server statistics show queries per second, slow queries, threads connected, and cache hit rates. These metrics help identify performance issues.
Slow query mode filters display to queries exceeding a time threshold. This focuses attention on problematic operations.
The kill command terminates runaway queries. Combined with filtering, it helps manage query overload situations.
Connection to remote servers enables monitoring multiple databases from one location.
PARAMETERS
-u USER
MySQL username.-p PASS
MySQL password.-h HOST
MySQL server hostname.-d DB
Default database.-P PORT
MySQL port.-s SECONDS
Slow query threshold.-i
Show idle connections.--delay SECONDS
Refresh interval.--color
Use ANSI color.--batch
Batch mode (no updates).
KEY COMMANDS
q
Quit.k
Kill a query/thread.f
Toggle full query display.s
Change sort column.r
Reverse sort order.p
Pause display.?
Help.
CAVEATS
Requires MySQL PROCESS privilege. Some features need SUPER privilege. Not actively maintained - consider alternatives like innotop. May not support all MariaDB features.
HISTORY
mytop was written by Jeremy Zawodny around 2000 when he worked at Yahoo. It became a standard tool for MySQL administrators, filling the gap for real-time server monitoring before such features were built into management tools.
SEE ALSO
innotop(1), mysql(1), mysqladmin(1), pt-query-digest(1)
