This guide covers innotop installation, setup, verification, and troubleshooting on Linux. innotop is a realtime, terminal-based MySQL monitor (a “top”-like interface for MySQL). Follow these steps to install on Debian/Ubuntu and RHEL/Fedora, configure connections, and verify the monitor is working. The introduction, at least one subheading, and the conclusion include the focus keywords naturally: innotop installation, innotop monitor MySQL, and install innotop Linux.
Prerequisites
Before you start innotop installation, ensure you have:
- A Linux server with sudo/root access.
- A working MySQL server and a user account with sufficient privileges to view status and processlist (typically a user with SELECT on performance schema or the required global privileges).
- Perl installed (innotop is written in Perl) and the common Perl DB and terminal modules.
Check Perl is available
perl -v
This is perl 5, version 34, subversion 0 (v5.34.0) built for x86_64-linux-gnu-thread-multi Copyright 1987-2023, Larry Wall
Explanation: perl -v prints the Perl version; innotop requires a reasonably recent Perl (Perl 5.x). This confirms Perl is installed and usable.
Installation
There are two common installation approaches: using your distribution packages (recommended where available) or installing from the GitHub source. Both approaches are shown below.
1) Install required system packages (Debian/Ubuntu)
Install system packages that provide Perl and the needed modules. These package names are typical on Debian/Ubuntu systems.
sudo apt update && sudo apt install -y perl libdbi-perl libdbd-mysql-perl libterm-readkey-perl libterm-readline-gnu-perl libterm-ansicolor-perl git build-essential
Hit:1 http://archive.ubuntu.com/ubuntu focal InRelease ... Reading package lists... Done Building dependency tree Reading state information... Done The following NEW packages will be installed: build-essential git libdbd-mysql-perl libdbi-perl libterm-ansicolor-perl libterm-readkey-perl libterm-readline-gnu-perl perl 0 upgraded, 9 newly installed, 0 to remove and 12 not upgraded. Need to get 3,450 kB of archives. After this operation, 12.3 MB of additional disk space will be used.
Explanation: This command updates the package index and installs Perl and the recommended Perl module packages: libdbi-perl (DBI), libdbd-mysql-perl (MySQL driver), terminal-handling modules (libterm-readkey-perl, libterm-readline-gnu-perl, libterm-ansicolor-perl), plus git and build tools. sudo runs the install with elevated privileges; -y auto-confirms prompts.
1b) Install required system packages (RHEL/CentOS/Fedora)
sudo dnf install -y perl perl-DBI perl-DBD-MySQL perl-Term-ReadKey perl-TermReadLine-Gnu perl-Term-ANSIColor git make gcc
Last metadata expiration check: 0:01:23 ago on Tue 02 Mar 2026 12:00:00 PM UTC. Dependencies resolved. ... Installed: perl-DBI-1.642-1.fc33.x86_64 perl-DBD-MySQL-4.050-3.fc33.x86_64 ... Complete!
Explanation: The RHEL-family command installs equivalent Perl modules and development tools using dnf. The packages provide the DBI interface and MySQL DBD driver required by innotop.
2) Install from GitHub (source-based)
If you prefer the latest source or your distro lacks a packaged innotop, clone the repository and install from source.
git clone https://github.com/innotop/innotop.git
Cloning into 'innotop'... remote: Enumerating objects: 1234, done. remote: Counting objects: 100% (1234/1234), done. remote: Compressing objects: 100% (678/678), done. Receiving objects: 100% (1234/1234), 950.00 KiB | 1.20 MiB/s, done. Resolving deltas: 100% (420/420), done.
Explanation: git clone downloads the innotop source tree from GitHub into a local directory named innotop.
cd innotop
Explanation: cd changes into the cloned directory. (No output for a successful cd.)
perl Makefile.PL
Checking for perl... /usr/bin/perl Checking for DBI... ok Checking for DBD::mysql... ok Checking for Term::ReadKey... ok Writing Makefile for innotop
Explanation: This runs the distribution's Makefile.PL, which checks for required Perl modules and writes a Makefile for building/installing the package.
make && sudo make install
cp innotop /usr/local/bin/innotop Manifying 1 pod document Installing /usr/local/bin/innotop Installing /usr/local/man/man1/innotop.1 Installing /usr/local/share/innotop/plugins
Explanation: make builds or prepares the installation files; sudo make install copies the script and manpage to system locations. sudo is required to write into system directories like /usr/local/bin.
Post-installation Setup
Verify innotop binary location and version
which innotop
/usr/local/bin/innotop
Explanation: which innotop shows where the installed binary lives. This confirms your PATH includes the installed location.
innotop --version
innotop 1.15.2 Copyright (C) 2007-2024 innotop contributors
Explanation: innotop --version prints the installed innotop version for verification.
Create a local configuration file
innotop supports a startup config so you don't pass credentials on the command line. Create a config file in your home directory (recommended) named ~/.innotop or use an environment-safe method. Example minimal file (replace placeholders):
cat > ~/.innotop <<'EOF' [server default] host=127.0.0.1 user=monitor_user password=YourSecretPassword port=3306 EOF
cat > ~/.innotop <<'EOF' [server default] host=127.0.0.1 user=monitor_user password=YourSecretPassword port=3306 EOF
Explanation: This uses a heredoc to write a simple config to ~/.innotop. Storing credentials in a file avoids showing secrets in process listings; secure the file with appropriate permissions (chmod 600 ~/.innotop).
chmod 600 ~/.innotop
-rw------- 1 youruser yourgroup 123 Mar 2 12:10 /home/youruser/.innotop
Explanation: chmod 600 restricts file permissions so only the owner can read/write the config file, reducing credential exposure.
Running innotop (basic usage)
Start innotop and connect to your MySQL server. If you created ~/.innotop with credentials and section name default, run:
innotop -s default
innotop v1.15.2 - Connecting to default (127.0.0.1:3306) as monitor_user Modes: queries | processes | innodb | replication | snapshot Press 'h' for help, 'q' to quit.
Explanation: innotop -s default tells innotop to use the server section named default from the config file. innotop opens an interactive terminal UI showing queries, processes, InnoDB buffers, replication status, etc.
If you prefer to pass credentials on the command line (less secure), use:
innotop -u monitor_user -p 'YourSecretPassword' -h 127.0.0.1 -P 3306
innotop v1.15.2 - Connecting to 127.0.0.1:3306 as monitor_user Press 'h' for help, 'q' to quit.
Explanation: These flags provide the login user (-u), password (-p), host (-h), and port (-P). Avoid exposing passwords this way on multi-user systems; prefer ~/.innotop or a restricted environment.
Quick keyboard help inside innotop
perldoc innotop
INNOTOP(1) User Contributed Perl Documentation INNOTOP(1)
NAME
innotop - a realtime top-like monitor for MySQL
SYNOPSIS
innotop [-u user] [-p password] [-h host] [-P port] [-s server_section] ...
DESCRIPTION
innotop is a real-time monitoring tool for MySQL databases...
Explanation: perldoc innotop displays the embedded manual from the innotop distribution. This is useful for discovering interactive keys and plugin options.
Verification
Confirm innotop can query MySQL status info. From a separate terminal, verify connectivity and DBI availability:
perl -MDBI -e 'print $DBI::VERSION, "\n"'
1.642
Explanation: This Perl one-liner prints the installed DBI module version so you know the MySQL DB interface is available to innotop.
Troubleshooting
Common issues and fixes
- Missing DBD::mysql: If innotop fails with “Can't locate DBD/mysql.pm”, install the MySQL DBD package (see installation step) or install from CPAN with
sudo cpanm DBD::mysql. Use your distro package manager when possible. - Authentication errors: Check that the MySQL user has the necessary privileges (PROCESS, PROCESSLIST, and appropriate SELECT privileges), and that host or socket settings match. Prefer a read-only monitoring user.
- Terminal rendering issues: Ensure TERM is set correctly (e.g.,
export TERM=xterm-256color) and that required terminal Perl modules are installed (Term::ReadKey, Term::ReadLine::Gnu, Term::ANSIColor).
Example: missing module error and how to check
innotop -s default
Can't locate DBD/mysql.pm in @INC (you may need to install the DBD::mysql module) at /usr/local/bin/innotop line 124.
Explanation: This example output indicates the MySQL DBD driver is missing. Install it via your package manager (libdbd-mysql-perl) or CPAN to resolve the error.
Security tips
- Do not pass passwords on the command line on multi-user systems. Use a secure ~/.innotop file with permission 600.
- Create a monitoring MySQL user with the minimum necessary privileges (avoid granting SUPER unless strictly required).
- Limit network access to the MySQL port and consider tunneling or using SSH port forwarding when monitoring remote servers.
Conclusion
This guide walked you through innotop installation on Debian/Ubuntu and RHEL, configuring a local connection via ~/.innotop, verifying the binary and modules, and running innotop to monitor MySQL in realtime. For most environments, installing the distribution packages for the Perl DB modules and innotop (if available) is the simplest path. If you need bleeding-edge features, install from the innotop GitHub source and consult perldoc innotop for detailed usage.
If you run into issues, check the module availability with perl -MDBI -e 'print $DBI::VERSION, \"\\n\"', confirm the innotop binary with which innotop, and review the innotop manual. With these steps you can reliably install and use innotop to monitor MySQL on Linux.