Monitoring MySQL Databases

Monitoring MySQL Databases

Servers

Monitoring MySQL Databases

Monitor MySQL instances and their databases in real time. Track availability, connections, query performance, storage engine health, replication status, and more from a single view.

Overview

Cloudmon provides deep monitoring for MySQL database servers running on both Windows and Linux. Once an instance is registered, all databases within it are automatically discovered and monitored at two levels: the instance level, covering the MySQL server as a whole, and the database level, covering each individual database running within it.

Navigate to Servers → Database → MySQL → MySQL Instance to view all monitored instances, or to Servers → Database → MySQL → MySQL Database for a cross-instance view of all databases.

Prerequisites

Before registering a MySQL instance, a dedicated MySQL user must be created for the Cloudmon agent. The user can be restricted to localhost or allowed to connect from any host depending on whether the agent is installed locally or remotely.

Create the user and grant the required privileges by running the following on the MySQL server:

SQL — Run on MySQL Server
CREATE USER 'username'@'hostname' IDENTIFIED BY 'password';

GRANT REPLICATION CLIENT ON *.* TO 'username'@'hostname';
GRANT REPLICATION SLAVE ON *.* TO 'username'@'hostname';
GRANT PROCESS ON *.* TO 'username'@'hostname';
GRANT SHOW DATABASES ON *.* TO 'username'@'hostname';

GRANT SELECT ON performance_schema.* TO 'username'@'hostname';

GRANT SELECT ON sys.* TO 'username'@'hostname';
GRANT EXECUTE ON sys.* TO 'username'@'hostname';

Replace username, hostname, and password with your chosen values. Use localhost as the hostname if the agent is installed on the same machine as the MySQL server, or % to allow connections from any host for remote agent setups. The MySQL server and listener must be reachable from the agent host.

Next, install the Cloudmon agent on the system that will perform the monitoring, whether that is the MySQL server itself or a separate remote host. With the agent installed, run the following command on that machine to register the MySQL instance for monitoring:

Linux
./usr/local/cloudmon/agent/cloudmon-agent --run mysql --add-instance
Windows
.C:\Program Files (x86)\Cloudmon\cloudmonAgent.exe --run mysql --add-instance

Adjust the path above if your agent is installed elsewhere. Once the command is run, the agent verifies connectivity to the database and begins collecting and forwarding metrics to the Cloudmon server. The newly registered instance will then appear under Servers → Database → MySQL → MySQL Instance in the Cloudmon web UI.

MySQL Instance

MySQL Instance monitoring covers the MySQL server as a whole. Cloudmon tracks availability, uptime, active and maximum connections, slow queries, network traffic, storage engine health, replication activity, command volumes, and the complete live server configuration from a single view.

The instance list ranks servers by connections, queries, slow queries, and network traffic, so the highest-load instances are always visible at a glance. An Instances Breakdown panel shows the hierarchical relationship between each server and its databases. Within an instance, Cloudmon monitors InnoDB in depth, covering buffer pool usage, row reads and writes, row lock waits, pages I/O, data bandwidth, and fsync activity. For environments using MyISAM, key buffer usage, key reads and writes, and key I/O are tracked separately.

Binary log disk growth, cache pressure, and replication command activity are monitored continuously, which is critical for any environment relying on MySQL replication or point-in-time recovery. The full live server configuration is surfaced alongside all performance data, so teams can correlate behaviour with the configuration driving it without querying the server directly.

MySQL Database

MySQL Database monitoring provides visibility into each individual database within an instance. The database list page surfaces all databases across all monitored instances and ranks them by size, I/O, queries, latency, and throughput, making it easy to identify which database is driving the most load or consuming the most space across the entire environment.

Each database has its own availability tracking, query performance metrics, latency, throughput, I/O read and write activity, row statistics, and temp table counts. The Sequential versus Index Scans metric is particularly useful here: a high proportion of sequential scans relative to index scans is a strong signal that queries are missing indexes, which is often difficult to identify at the instance level alone. Errors and warnings are tracked at the database level as well, giving teams the context to distinguish whether an issue is isolated to one database or symptomatic of a broader server problem.

Alarms

Cloudmon supports threshold-based alarms on any MySQL metric collected at the instance or database level, including connections, slow queries, InnoDB row lock waits, replication activity, and tablespace usage. Each alarm is built around a simple IF/THEN model, where you select a metric, set a threshold, and define what happens when it is breached. Learn more.

Troubleshooting

SymptomLikely CauseFix
Instance not appearing in the listInstance not registered, or the agent cannot reach MySQL on the configured portRe-run the registration command from the correct agent directory and verify the hostname, port, and credentials
High Slow Query countQueries performing full table scans or missing indexesEnable the Slow Query Log and review queries exceeding the Long Query Time threshold; add indexes where needed
Rising InnoDB Row Lock WaitsConcurrent transactions contending for the same rowsIdentify long-running transactions holding locks and reduce transaction scope to minimise contention
High Aborted Connections countClients failing authentication or connections timing out before completingCheck MySQL error logs for authentication failures and review application connection pool timeout settings
Binlog disk growing rapidlyBinlog expiry not configured, or a replica lagging and preventing log purgeSet binlog_expire_logs_seconds to an appropriate retention period and investigate replica lag
Database not appearing in the listThe parent instance has not been registered or the agent is not runningConfirm the MySQL instance is registered and the Cloudmon agent is active on the host
High query latency on a specific databaseQueries on that database performing full table scans or experiencing lock contentionReview the Sequential vs Index Scans metric for that database and add indexes where full scans are occurring