What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
mytop is a terminal-based, top-like monitor for live MySQL and MariaDB activity. It refreshes server status and active threads, helping you find long-running queries, blocked sessions, unusual load, and changes in queries per second without leaving the command line. The maintained fevangelou/mytop fork is version 2.1, released July 5, 2026, and targets MySQL 8.x and MariaDB 10.3 and newer. This guide covers installation, secure connections, permissions, display fields, interactive diagnostics, batch snapshots, and the situations where Performance Schema is a better choice.
Need a server to try this on? Antihost offers Linux VPS plans with NVMe storage, full root access and a 14-day free trial.
What mytop does and when it is useful
mytop repeatedly queries a MySQL-compatible server and presents a live dashboard similar in spirit to the Unix top command. The default refresh delay is one second. The screen combines server uptime, queries per second (QPS), load average, query-cache hit information when the server exposes it, and a process list showing active connections and statements.
As an Amazon Associate I earn from qualifying purchases.
Quick wins for a faster PC:
Scan for outdated or missing drivers - takes under a minuteDriver Scan →Repair Windows errors before they cause bigger problemsFix Now →Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →Use it when you need an immediate operational answer: Which session is running for minutes? Is one application user generating the load? Are connections waiting on a lock? Is a particular database or host responsible? mytop is an interactive view, not a historical monitoring system. It does not replace retained metrics, query sampling, or a detailed Performance Schema investigation.
Requirements and compatibility
The current fork is a standalone Perl script. Install Perl database interfaces and the terminal input module before launching it.
#1 Best Overall
| Environment | Documented compatibility or packages | Qualification |
|---|---|---|
| MySQL | MySQL 8.x is the target; the project also lists MySQL 5.x and MySQL 8.0+ compatibility. | Validate the exact server and driver combination in your environment. |
| MariaDB | MariaDB 10.3 and newer are targeted; the project lists MariaDB 10.x and 11.x. | mytop detects either DBD::mysql or DBD::MariaDB. |
| Operating systems | Linux, other Unix-like systems, and macOS are listed. | Windows support is marked uncertain. |
| Perl modules | DBI, a MySQL/MariaDB DBI driver, and Term::ReadKey. | The driver must be able to connect to the server you intend to monitor. |
Install mytop
Debian 11 or newer and Ubuntu 22.04 or newer
Install the packages documented by the maintained fork:
sudo apt update
sudo apt install libdbi-perl libdbd-mysql-perl libterm-readkey-perl
These packages provide Perl’s DBI layer, the MySQL driver, and terminal key handling. Start the program after installation with mytop if the script is already on your PATH.
RHEL 7 and newer
sudo yum install perl-DBI perl-DBD-MySQL perl-TermReadKey
On systems using a newer package manager, the equivalent dnf command may be appropriate for the same package names.
RHEL 9+ with MariaDB.org or cPanel repositories
The README warns that mysql-common and MariaDB-common can conflict. If the distribution packages do not resolve cleanly, install the build prerequisites and MariaDB development files, then install the MariaDB DBI driver through CPAN:
sudo dnf install gcc make MariaDB-devel
cpan DBD::MariaDB
mytop can detect DBD::MariaDB automatically. Keep the driver matched to the client libraries supplied by your repository; mixing incompatible MySQL and MariaDB client packages is a common cause of linker and connection errors.
Direct installation of the standalone script
The project documents downloading the script directly and making it executable:
Outdated Drivers Are Slowing You Down
One free scan finds every outdated or missing driver and matches the right update for your exact hardware.Free scan · exact hardware matchPC Slower Than It Used to Be?
A free scan shows the junk files, broken settings and background clutter dragging Windows down - then fixes them in one click.Free scan · Windows 10 & 11sudo curl -fsSL -o /usr/local/bin/mytop https://raw.githubusercontent.com/fevangelou/mytop/main/mytop
sudo chmod +x /usr/local/bin/mytop
mytop
The download URL is the maintained fork’s raw script endpoint: https://raw.githubusercontent.com/fevangelou/mytop/main/mytop. Direct installation still requires DBI, a database driver, and Term::ReadKey. If mytop starts but reports a missing Perl module, install the module before troubleshooting the database connection.
Connect to a local or remote server
With no arguments, mytop uses its documented defaults: database mysql, port 3306, and a one-second refresh delay. Supply connection details when the server, socket, or monitoring account differs:
mytop --host db.example.internal --port 3306 --user monitor --db mysql
mytop --socket /var/run/mysqld/mysqld.sock --user monitor
mytop --host db.example.internal --user monitor --prompt
Use --password when required, but prefer --prompt or protected client configuration. A password written directly in a command can be visible to other users through process inspection and may be retained in shell history. The maintained fork supports a ~/.mytop file containing connection and display settings:
host=db.example.internal
port=3306
db=mysql
user=monitor
pass=use-a-protected-secret
delay=1
socket=/var/run/mysqld/mysqld.sock
Protect this file with operating-system permissions appropriate to the account that runs mytop. If your security policy forbids storing a password in ~/.mytop, omit pass and use a prompt or an already protected MySQL client configuration instead.
Remote connection checks
Before diagnosing mytop, verify that the host is reachable from the monitoring machine and that the database accepts remote connections. The server’s bind address, TCP port, firewall rules, TLS requirements, and account host restrictions can all prevent a connection even when mytop is installed correctly. Test with an ordinary MySQL client using the same host, port, user, and authentication method; a client failure is a network or account problem, not a display problem.
Give the monitoring account the right visibility
MySQL’s process-information rules determine what mytop can show. The official manual states: For most sources of process information, if you have the PROCESS privilege, you can see all threads.
Without PROCESS, a nonanonymous account generally sees only its own threads. That means mytop may appear to work while hiding the application sessions you are trying to investigate.
Ask a database administrator to grant the minimum rights required by your monitoring policy. A typical administrative decision is whether the account may see every session or only sessions owned by that account. Do not grant broad write or administrative privileges merely to obtain visibility. Confirm the result by connecting as the monitoring account and checking whether sessions belonging to another user appear.
Understand the mytop display
The current fork reports global status at the top and a process list below it. Read the fields together rather than treating a single high number as proof of a fault.
Recommended Free Tools
| Field or view | What it tells you | Important limitation |
|---|---|---|
| Uptime | How long the server has been running. | A restart resets status counters and can make recent rates look unusual. |
| QPS | Approximate query activity during the polling interval. | It is a live rate, not a retained time series; polling itself adds queries. |
| Load average | Operating-system load reported to the display. | Interpret it against CPU count, storage latency, and the host’s other workloads. |
| Query-cache hit information | Cache statistics when available from the server. | MySQL 8 removed the query cache, so this value may be absent or irrelevant. |
| Id | The client connection or thread identifier. | Use it to identify a session for inspection or termination. |
| User and Host | The account and client host associated with the connection. | Visibility depends on privileges. |
| db | The session’s default database. | A statement can still reference objects in other databases. |
| Command and State | What the thread is doing and its current state. | A state lasting many seconds can indicate a problem, but normal work can also have measurable states. |
| Time | Seconds the thread has remained in its current state. | It is not always the total lifetime of the connection or transaction. |
| Info | The statement currently executing, or NULL when none is executing. | Native SHOW PROCESSLIST truncates Info to 100 characters; full output requires SHOW FULL PROCESSLIST or another process-information source. |
The display can also summarize commands by type. A thread that is sleeping is not automatically harmful; the useful question is whether sleeping sessions consume connection capacity, hold transactions open, or prevent cleanup.
Rank #4
A practical interactive diagnostic workflow
- Start with the narrowest safe connection. Run
mytoplocally, or provide--host,--port,--user, and a prompt for a remote server. Confirm that the account can see the sessions relevant to the incident. - Remove idle noise. Press
i, or start with-i, to hide sleeping threads. This makes active work easier to scan. Restore idle sessions when investigating connection leaks or long-lived transactions. - Choose a useful sort order. Sort by elapsed time to find the oldest active work, or by state, user, database, or host to find concentration. Re-sort after changing a filter; the most informative ordering depends on the question you are asking.
- Adjust refresh speed. Press
sor use-sto change the refresh interval. A one-second interval is useful during a short incident, while a slower interval reduces polling overhead during observation. - Filter the population. Use
dfor database,ufor user,hfor host, ortfor state. Filtering separates an application’s traffic from unrelated system sessions. - Reveal the complete statement. Press
ffor full query information when the normal row is truncated. Save the thread Id, account, host, state, and elapsed time before changing anything. - Explain an individual query. Select an explainable thread and press
eto run EXPLAIN by thread ID. EXPLAIN is not valid for every command or server state, so an error does not necessarily mean the query is invalid. - Inspect InnoDB. Press
Ifor InnoDB status when rows suggest lock waits, flushing, deadlocks, or storage pressure. Use the status output to distinguish a query problem from an engine-level problem. - Switch to rates or summaries. Press
mfor QPS mode when throughput is the key signal, orcfor a command summary when you need to see whether selects, updates, inserts, or other command classes dominate. - Terminate only a confirmed offender. Press
korKonly after confirming the session is safe to stop with the application owner. Killing a thread can roll back work, release locks, or disrupt a request in production.
How to investigate common symptoms
A query has been running for a long time
Sort by elapsed time, reveal the full statement with f, and record the thread Id, user, host, database, state, and time. Check whether the state indicates waiting rather than CPU execution. Use e when EXPLAIN is supported, and compare the plan with expected indexes and row counts. A long elapsed time alone is not enough reason to kill the thread: it may be a deliberate report, a transaction doing useful work, or a session waiting on a resource that another team must fix.
Many sessions are blocked
Filter by state with t, then inspect the longest waits and their users and hosts. Press I to inspect InnoDB status for lock information and deadlock clues. Identify the blocking transaction before terminating anything; ending a waiting session may hide the symptom while leaving the blocker untouched.
QPS suddenly rises
Use m to focus on rate, then c to identify the command type responsible. Filter by user, host, or database to locate the source. Compare the live view with application logs or an external time series because mytop does not retain a historical baseline.
The server appears busy but rows are sparse
Sleeping threads may be hidden by -i or the interactive i setting. Restore them and check connection counts, idle transaction behavior, and whether the account lacks PROCESS visibility. Also remember that load can come from background engine work or operating-system activity not represented by an active SQL statement.
Use batch mode for snapshots and automation
--batch produces a one-shot, scriptable snapshot instead of an interactive screen. Add --header when collecting output for logs so each sample retains its column headings:
Best Value
mytop --host db.example.internal --user monitor --prompt --batch --header
Batch output is useful for incident records, cron-driven checks, and simple comparisons between samples. It is not a substitute for a metrics system: parsing a terminal-oriented report can break when display details change, and one snapshot cannot show trends.
Polling overhead and Performance Schema alternatives
mytop’s convenience comes from polling process and status information. Its own queries contribute a small amount of work and can affect status counters, especially when the refresh interval is very short or the server is already under pressure. Increase the delay during prolonged observation and avoid repeatedly launching many mytop instances against the same server.
Do these 3 things before closing this tab:
1Fix the driver behind crashes, sound loss and screen glitches2Clear out junk files and repair common Windows errors3Scan for outdated or missing drivers - takes under a minuteMySQL documents several process-information sources: SHOW PROCESSLIST, INFORMATION_SCHEMA.PROCESSLIST, Performance Schema processlist and threads tables, and sys-schema processlist or session views. The official manual notes that access to the Performance Schema threads table does not require a mutex and has minimal impact on server performance, whereas other sources can have negative performance consequences because they require a mutex. For a high-volume production server or low-overhead instrumentation, use Performance Schema and sys-schema views directly or through a monitoring platform, and reserve mytop for fast human inspection.
This is an architectural trade-off, not a claim that mytop is unsafe. A one-second interactive view is valuable during diagnosis; continuous, high-frequency polling should be designed with the server’s workload and contention characteristics in mind.
Quick Recap
Troubleshooting installation and connection failures
- “Can’t locate DBI” or a driver error: install the DBI package and either
DBD::mysqlorDBD::MariaDB. Confirm that the Perl interpreter running mytop can load the module. - “Can’t locate Term/ReadKey”: install
libterm-readkey-perlon Debian/Ubuntu orperl-TermReadKeyon RHEL. - RHEL package conflicts: on RHEL 9+ with MariaDB.org or cPanel repositories, check for conflicting
mysql-commonandMariaDB-commonpackages. Use the documented compiler, development package, and CPAN path when repository packages cannot coexist. - Access denied: verify the username, authentication method, password prompt, and the account’s permitted source host. A correct password can still fail when the account is not allowed from the monitoring machine.
- Connection refused or timeout: verify the server bind address, firewall, port, socket path, and network route. Test the same parameters with a standard MySQL client.
- Only your own sessions appear: ask for
PROCESSor accept that the account is intentionally restricted. This is a privilege behavior, not a mytop filtering bug. - Missing or odd query-cache values: MySQL 8 removed the query cache. Treat that field as conditional and rely on current status and Performance Schema data instead.
- EXPLAIN fails: the selected statement may not support EXPLAIN, may have finished, or may require syntax specific to the server version. Capture the full statement before it disappears and explain it separately when necessary.
Operational checklist
- Install DBI, a compatible MySQL/MariaDB driver, and Term::ReadKey.
- Use the maintained v2.1 fork and verify the server-driver combination.
- Prefer password prompting or protected client configuration over secrets in command-line arguments.
- Grant only the visibility the monitoring account needs;
PROCESScontrols access to other users’ threads. - Hide sleeping sessions for active-work triage, then restore them when investigating idle connections or transactions.
- Capture full query text, thread Id, state, user, host, database, and elapsed time before taking action.
- Use InnoDB status and EXPLAIN to investigate causes, not merely symptoms.
- Terminate a thread only with an owner-approved recovery plan.
- Use slower polling or Performance Schema when the server is busy or monitoring must be continuous.
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

