Percona Monitoring and Management (PMM) is a free, open-source platform built on top of Prometheus, VictoriaMetrics, and Grafana that provides deep visibility into MySQL and other database workloads. PMM separates concerns into a centralised Server component (delivered as a Docker image) and a lightweight Client agent that runs on each database host. This guide walks through deploying PMM Server as a Docker container on RHEL 9, installing the PMM Client on a MySQL database server, and using Query Analytics (QAN) and the pre-built Grafana dashboards to identify slow queries and InnoDB resource bottlenecks.

Prerequisites

  • RHEL 9 server for PMM Server with Docker installed and running
  • RHEL 9 database server with MySQL 8.0 or compatible running
  • A MySQL user with SELECT, PROCESS, REPLICATION CLIENT, SUPER privileges for PMM
  • Network connectivity between the database server and the PMM Server on port 443
  • Firewall access to open port 443 on the PMM Server host

Step 1 — Deploy PMM Server as a Docker Container

PMM Server is distributed as an official Docker image. The container stores all metrics data in a named volume so data persists across container restarts. Expose port 443 for the HTTPS web UI and API.

# Pull the latest PMM Server image
docker pull percona/pmm-server:2

# Create a persistent data volume
docker volume create pmm-data

# Run PMM Server
docker run -d 
  --name pmm-server 
  --restart always 
  -p 443:443 
  -v pmm-data:/srv 
  percona/pmm-server:2

# Open the firewall on the PMM Server host
sudo firewall-cmd --permanent --add-port=443/tcp
sudo firewall-cmd --reload

# Verify the container is running
docker ps --filter name=pmm-server

Step 2 — Set the PMM Admin Password

On first startup, PMM Server generates a default admin password. Change it immediately before registering any clients. The PMM API is available at https://<server-ip> — accept the self-signed certificate warning or supply your own TLS certificate later.

# Wait ~60 seconds for PMM Server to initialise, then change the password
docker exec -it pmm-server bash -c 
  'pmm-admin --server-url=https://admin:admin@localhost change-password --new-password=StrongPass123!'

# Alternatively, set it through the Grafana UI:
# https://  ->  Login: admin / admin  ->  Follow the change-password prompt

Step 3 — Install PMM Client on the Database Server

Install the pmm2-client package from the Percona repository on the RHEL 9 host running MySQL. The client includes the pmm-admin command-line tool and the pmm-agent daemon that scrapes and forwards metrics.

# Install the Percona repository
sudo dnf install -y https://repo.percona.com/yum/percona-release-latest.noarch.rpm
sudo percona-release setup pmm2-client

# Install the PMM Client
sudo dnf install -y pmm2-client

# Register the client with PMM Server
sudo pmm-admin config 
  --server-url=https://admin:StrongPass123!@:443 
  --server-insecure-tls

# Confirm registration
sudo pmm-admin status

Step 4 — Create the MySQL Monitoring User and Add the Service

Create a dedicated MySQL user with the minimum required privileges for PMM, then register the MySQL instance with pmm-admin add mysql. The --query-source=perfschema flag configures PMM to read slow query data from the MySQL Performance Schema rather than the slow query log.

# On the MySQL server, create the PMM monitoring user
mysql -u root -p <<'EOF'
CREATE USER 'pmm'@'localhost' IDENTIFIED BY 'pmmpass' WITH MAX_USER_CONNECTIONS 10;
GRANT SELECT, PROCESS, REPLICATION CLIENT, RELOAD ON *.* TO 'pmm'@'localhost';
GRANT SELECT, UPDATE, DELETE, DROP ON performance_schema.* TO 'pmm'@'localhost';
FLUSH PRIVILEGES;
EOF

# Register MySQL with PMM
sudo pmm-admin add mysql 
  --query-source=perfschema 
  --username=pmm 
  --password=pmmpass 
  --host=127.0.0.1 
  --port=3306 
  --service-name=mysql-prod-01

# Confirm the service is registered
sudo pmm-admin list

Step 5 — Explore Query Analytics and Grafana Dashboards

Log into the PMM web UI at https://<pmm-server-ip>. The Query Analytics (QAN) section shows the top queries by latency, total execution time, and rows examined. The pre-built Grafana dashboards under MySQL provide real-time InnoDB buffer pool hit rates, lock waits, replication lag, and many other key metrics.

# Key PMM UI navigation paths:
# PMM -> Query Analytics          — top queries by latency/calls
# Dashboards -> MySQL -> MySQL InnoDB Metrics   — buffer pool, I/O, row ops
# Dashboards -> MySQL -> MySQL Overview         — connections, QPS, slow queries
# Dashboards -> MySQL -> MySQL Replication      — replication lag, binlog pos

# From the CLI, list registered services and their status
sudo pmm-admin list

# Remove a service if needed
# sudo pmm-admin remove mysql mysql-prod-01

Conclusion

You have deployed PMM Server as a persistent Docker container on RHEL 9, installed and registered the PMM Client on a MySQL host, and connected the monitoring user with the minimum necessary privileges. PMM now continuously collects query metrics via the Performance Schema and exposes them through Query Analytics and over 40 pre-built Grafana dashboards. QAN is particularly powerful for identifying N+1 query patterns and missing indexes — click any query fingerprint to see its execution plan breakdown and example calls over time. For production environments, consider running PMM Server on a dedicated host with at least 8 GB RAM and deploying with a signed TLS certificate to replace the default self-signed one.

Next steps: How to Install and Configure Nagios Core on RHEL 9, How to Set Up OpenTelemetry Collector on RHEL 9, and How to Install Jaeger for Distributed Tracing on RHEL 9.