Troubleshooting MySQL Monitor Addition Problems

Troubleshooting MySQL Monitor Addition Problems

Applies to: MySQL Database Server and MariaDB monitors.

When adding a MySQL Database Server monitor in Applications Manager, you may encounter connection errors that prevent the monitor from being added successfully. This article explains the common connection errors, their possible causes, and the steps to troubleshoot them.

Follow the troubleshooting steps corresponding to the error displayed while adding the MySQL monitor.

1. Host or Port Not Reachable

Error messagePlease check if the DB server is running in the given host and port.

Underlying driver errors: Socket fail to connect to ... · Read timed out · Socket timeout when connecting

Possible causes:

  • The hostname or IP address is incorrect.
  • The MySQL server is not listening on the configured port.
  • The MySQL service is stopped.
  • A firewall or network restriction is blocking the connection.
  • The MySQL server is listening only on the loopback address.

Troubleshooting steps:

  1. Verify that the hostname or IP address configured in Applications Manager is correct.
  2. From the Applications Manager server, verify that the hostname resolves to the expected IP address.
    nslookup <mysql-host>
  3. Verify that the configured MySQL port is reachable from the Applications Manager server.
    Windows:  Test-NetConnection <mysql-host> -Port <mysql-port>
    Linux: nc -vz <mysql-host> <mysql-port>
  4. Verify that the MySQL service is running on the database server.
  5. Check the MySQL bind-address configuration. If the server is listening only on 127.0.0.1, remote connections may not be accepted.
  6. Verify that the configured port is the actual MySQL listening port.
  7. Check whether any firewall, VPN or network security policy is blocking the connection between the Applications Manager server and the MySQL server.

2. MySQL Server Is Not Accessible

Applications Manager shows one of two messages when the MySQL server answers but will not accept the account. In both cases the network and the port are fine — the connection reached MySQL. What differs is how far it got, so match the message you see and follow that part.

Error messageThe MySQL Server is not accessible from the Applications Manager Server host.

Driver error behind it: Host '<address>' is not allowed to connect to this MySQL server  →  go to 2.1.

Error messageAccess denied. Check the user name and password, and check that this user is allowed to connect from the Applications Manager host.

Driver error behind it: Access denied for user '<user>'@'<host>' (using password: YES)  →  go to 2.2.

2.1 Host '<address>' is not allowed to connect to this MySQL server

What it means: MySQL has no account at all for the address Applications Manager connected from. In MySQL an account is a pair of user name and host, so 'monitor'@'localhost' and 'monitor'@'10.0.0.5' are two different accounts. Creating one does not create the other.

Use the address printed in the message, not the one shown on the Applications Manager machine. MySQL reports the address it actually sees, which can be a NAT, gateway or container address.

Troubleshooting steps:

  1. On the MySQL server, list the accounts that exist for the monitoring user.
    SELECT user, host
    FROM mysql.user
    WHERE user = '<monitoring-user>';
  2. Compare the host column with the address in the error message. If no row matches it, the account for that address does not exist.
  3. Create the account for that address.
    CREATE USER '<monitoring-user>'@'<appmanager-address>' IDENTIFIED BY '<password>';
  4. Grant it the privileges the monitor needs, then reload the grant tables.
    GRANT SELECT, SHOW DATABASES, REPLICATION CLIENT, PROCESS
    ON *.*
    TO '<monitoring-user>'@'<appmanager-address>';

    FLUSH PRIVILEGES;
  5. If the Applications Manager host's address can change — DHCP, a container, or a failover pair — ask your database administrator whether an account for a range, such as '<monitoring-user>'@'10.0.0.%', is acceptable in your environment. Grant the narrowest range that covers the host.
  6. Save the monitor again, or wait for the next poll.

If the same message returns with a different address each time, the connection is leaving through more than one route. Give your network team the addresses from the messages and ask which one the MySQL server should expect.

2.2 Access denied for user

Error messageAccess denied for user '<user>'@'<host>' (using password: YES)
Access denied for user '<user>'@'<host>' (using password: NO)

What it means: MySQL rejected the login. It returns the same message whether the password was wrong or no account exists for that user at that address, and it does not tell you which - that is deliberate, so a stranger cannot learn which user names are real. The address in the message is where MySQL saw the connection arrive from, which is not always the host you typed into the monitor.

  • (using password: NO) — no password reached MySQL. Check the password field on the monitor.
  • (using password: YES) — a password was sent. Either it did not match, or there is no account for that user at that address.

Troubleshooting steps:

  1. Start with the address, not the password. Read the host out of the error message, then list the rows that exist for that user.
    SELECT user, host FROM mysql.user WHERE user = '<monitoring-user>';
    If no row's host matches the address in the message, either exactly or through a wildcard such as %, there is no account for MySQL to accept and the password is beside the point. This is common when the monitor points at a machine's own network address while the account exists only as localhost. Ask the DBA to create the account for that address, or point the monitor at a host the account already covers.
  2. If a row does match, check the user name and password configured on the monitor.
  3. Reproduce it from the Applications Manager machine, using the same host the monitor uses.
    mysql -h <the address shown in the error message> -P <mysql-port> -u <monitoring-user> -p
    Do not substitute localhost here. -h localhost connects over the local socket and authenticates as <user>@localhost, a different account row, so it can succeed while the monitor keeps failing.
  4. If that client connects but the monitor still fails, check the authentication plugin on the account.
    SELECT user, host, plugin
    FROM mysql.user
    WHERE user = '<monitoring-user>';
    An account on caching_sha2_password needs a recent connector. See How can I upgrade the MySQL connector JAR.

If the message instead ends with . Account is locked., or reads Your password has expired, the credential is not the problem. See 2.4.

2.3 Privileges the monitor needs

Error messageSELECT command denied to user '<user>'@'<host>' for table '<table>'
Access denied; you need (at least one of) the SUPER, REPLICATION CLIENT privilege(s) for this operation

The grant above covers the metrics Applications Manager collects by default. The exact set varies with the MySQL or MariaDB version and with the features you enable, so confirm the requirement for your version before applying it, and grant only what is needed.

  • SELECT and SHOW DATABASES — database and table statistics.
  • PROCESS — the session and process list.
  • REPLICATION CLIENT — replication status, when the server is part of a replication setup.
  • SELECT on performance_schema — replication state on MySQL 5.7 and above.
  • SELECT on the mysql system database — the password expiry and account status shown on the monitor page. Without it the rest of the monitor still works and only those attributes stay empty.

After changing privileges, run FLUSH PRIVILEGES; and then save the monitor again so the change is picked up without waiting for the next poll.

2.4 Monitoring account is expired or locked

Error messageYour password has expired. To log in you must change it using a client that supports expired passwords.
You must reset your password using ALTER USER statement before executing this statement.
Access denied for user '<user>'@'<host>'. Account is locked.

The user name and password are correct and MySQL accepted them. It then refused to let the account be used any further. An expired password comes from a password lifetime policy; a locked account was locked deliberately. Neither is fixed by re-entering the same credential, which is what separates this from section 2.2.

  1. Confirm which of the two states the account is in.
    SELECT user, host, account_locked, password_expired
    FROM mysql.user
    WHERE user = '<monitoring-user>';
  2. For an expired password, ask the DBA to set a new one, then update the stored credential in Applications Manager — in Credential Manager if the monitor uses a saved credential, otherwise on the monitor itself — and save the monitor so it is picked up without waiting for the next poll.
  3. For a locked account, ask the DBA to unlock it.
    ALTER USER '<monitoring-user>'@'<host>' ACCOUNT UNLOCK;
  4. A monitoring account is a service account, so the DBA may prefer to take it out of the expiry policy rather than rotate it on a schedule. Confirm this is acceptable under your own password policy before applying it.
    ALTER USER '<monitoring-user>'@'<host>' PASSWORD EXPIRE NEVER;

3. Incorrect Database Name

Error messageThe Database name given is wrong. Kindly reconfigure with correct values.

Underlying driver error: Unknown database 'X'

Possible causes:

  • The database name configured in Applications Manager is incorrect.
  • The database does not exist on the MySQL server.
  • The database name contains a spelling mistake.
  • The monitoring user does not have access to the specified database.

Troubleshooting steps:

  1. Connect to the MySQL server using a MySQL client.
  2. Verify whether the database exists.
    SHOW DATABASES;
  3. Verify that the database name configured in Applications Manager matches the name returned by the query.
  4. Check whether the monitoring user has the required privileges to access the database.
  5. If the database does not exist, create it or configure the monitor with the correct database name.

4. Connection Reset During Handshake

Error messagePlease check if the DB server is running in the given host and port.

Underlying driver error: Connection reset

Possible causes:

  • The MySQL server terminates the connection during the initial handshake.
  • A firewall or network device resets the connection.
  • SSL/TLS configuration mismatch between the client and server.
  • The MySQL server is overloaded or has reached its connection limit.
  • An incompatible MySQL JDBC driver is being used.

Troubleshooting steps:

  1. Verify that the MySQL server is running and accepting connections on the configured port.
  2. Check the MySQL error log for connection failures or handshake-related errors.
  3. Verify whether SSL/TLS is enabled on the MySQL server and whether the corresponding SSL configuration is enabled in Applications Manager.
  4. Check whether the MySQL server requires secure transport.
    SHOW VARIABLES LIKE 'require_secure_transport';
  5. If SSL is enabled, verify that the required certificates are configured correctly in Applications Manager.
  6. Verify whether the MySQL JDBC driver version is compatible with the MySQL server version.
  7. If the issue persists, check the MySQL server logs and Applications Manager logs to identify the reason for the connection reset.

5. Additional Troubleshooting

5.1 MySQL authentication plugin compatibility

If the following errors are encountered while adding the monitor:

  • Public Key Retrieval is not allowed
  • Client does not support authentication protocol requested by server
  • Invalid authorization specification, message from server:

Verify whether the MySQL authentication plugin configured for the monitoring user is supported by the JDBC driver used in Applications Manager. The last message means the server rejected the authentication method rather than the credentials, so the user name and password are not the thing to change.

SELECT user, host, plugin FROM mysql.user WHERE user = '<monitoring-user>';

caching_sha2_password on MySQL 8 requires a current connector. If the connector cannot be upgraded, ask the DBA to create the monitoring user with mysql_native_password.

Upgrading is the first of those two routes: the connector shipped with Applications Manager is replaced by hand, and the steps are in How can I upgrade the MySQL connector JAR?

For additional information, refer to Resolving MySQL Authentication Issues related to caching_sha2_password.

5.2 SSL connection errors

Error messageConnections using insecure transport are prohibited while --require_secure_transport=ON
SSL Connection required, but not supported by server
unable to find valid certification path to requested target

Three errors arrive here, and they are not the same fault. In the first the server insists on encryption and the connection did not offer it. In the second the monitor insists and the server cannot provide it. In the third both agreed to encrypt and Applications Manager would not trust the certificate it was shown. Match the message before changing anything - the fix for one makes the others worse.

The server requires encryption; the monitor did not use it

Connections using insecure transport are prohibited while --require_secure_transport=ON

  1. Confirm the requirement on the server.
    SHOW VARIABLES LIKE 'require_secure_transport';
  2. If it is ON, tick Force SSL on the monitor — Edit Monitor → Credential Details → Force SSL — and save. The monitor then connects with TLS and the server accepts it.
  3. Only ask the DBA to turn the requirement off if unencrypted monitoring is a deliberate choice for that server. Turning it off affects every client, not this monitor.

The monitor requires encryption; the server cannot provide it

SSL Connection required, but not supported by server

This is the mirror image of the case above: Force SSL is ticked on the monitor and the server has no TLS to offer.

  1. Check what the server supports. On MySQL 5.7 and earlier read have_ssl; on MySQL 8 and on MariaDB read tls_version, which is empty when TLS is not configured.
    SHOW VARIABLES LIKE 'have_ssl';
    SHOW VARIABLES LIKE 'tls_version';
  2. If the server has no TLS and should have, ask the DBA to configure it, then import the certificate as described below.
  3. If the server is deliberately unencrypted, untick Force SSL on the monitor.

The certificate is not trusted by Applications Manager

unable to find valid certification path to requested target

The handshake began and Applications Manager could not build a chain from the server's certificate to anything in its truststore — most often a self-signed certificate, or one issued by an internal CA the product has never been given.

This is not section 5.4. There, Applications Manager cannot open its own truststore at all. Here the truststore opened and simply does not hold this issuer.

If the message is instead about an authentication plugin refusing an untrusted certificate, the handshake itself succeeded and section 5.11 covers it.

  1. Obtain the server's certificate, or the CA certificate that signed it, from the DBA.
  2. Import it into the truststore that this monitor's driver reads, which is not the same one for both. The driver is on the monitor's Edit page, under Driver for Server Connection.
    • MariaDB driver, the default: cacerts — Settings → Manage Certificates → Trust Certificates.
    • MySQL driver: AppManager_Home\working\Cert\apm.keystore.
    Applications Manager hands apm.keystore to the MySQL driver only; with the MariaDB driver it leaves the trust anchors to the JVM default. A certificate in the other store changes nothing. Full steps for both: Import Certificates for MariaDB/MySQL Monitoring with SSL.
  3. Save the monitor again so the next poll uses the updated truststore.

5.3 TLS version mismatch

Error messageCommunication link failure: javax.net.ssl.SSLException

The SSL handshake started and failed. The usual cause is that the two sides share no TLS version. Applications Manager runs on Java 17, which refuses TLS 1.0 and TLS 1.1, so a MySQL server still restricted to those versions cannot complete a handshake with it.

  1. Check which versions the server offers.
    SHOW VARIABLES LIKE 'tls_version';
  2. If it lists only TLSv1 or TLSv1.1, ask the DBA to include TLSv1.2. The server needs a restart for the change to take effect.
Raise the server rather than weakening Applications Manager. Its TLS settings apply to every monitor it has, not only this one.

5.4 Truststore cannot be read

Error messageCould not load trustJKS keystore

This one is not about the MySQL server. Applications Manager could not open its own truststore. The file may be damaged, in a format Java cannot read, or protected by a password that no longer matches the one the product holds.

  1. Open the certificate screen and select List certificates. If the list cannot be shown, the truststore itself is the problem, which confirms the diagnosis.
  2. Re-import the server certificate through Trust certificates. Importing through the product rewrites the truststore correctly.
Never replace the truststore by copying a file over it. That is the usual cause of this error.

5.5 Unknown character set

Error messageUnknown character set

The MySQL server is using a character set the JDBC driver does not know. This is most often seen with newer collations against an older bundled connector.

  1. Check what the server uses.
    SHOW VARIABLES LIKE 'character_set_server';
    SHOW VARIABLES LIKE 'collation_server';
  2. Upgrade the MySQL connector shipped with Applications Manager. Refer to How can I upgrade the MySQL connector JAR?
  3. If the connector cannot be upgraded, ask the DBA whether the monitoring connection can use a character set the current driver supports.

5.6 Replication tables cannot be read

Error messageTable 'performance_schema.replication_connection_status' doesn't exist

On MySQL 5.7 and above, Applications Manager reads replication state from performance_schema and from SHOW REPLICA STATUS. These messages come from that collection alone. The connection itself is healthy and every other metric is still collected, so the monitor stays up while the replication attributes stay empty.

If the server instead reports SELECT command denied or asks for the REPLICATION CLIENT privilege, the table exists and the monitoring user cannot read it. That is a grant, so see section 2.3.

  1. Grant what the replication collection needs, then reload the grant tables.
    GRANT REPLICATION CLIENT ON *.* TO '<monitoring-user>'@'<host>';
    GRANT SELECT ON performance_schema.* TO '<monitoring-user>'@'<host>';
    FLUSH PRIVILEGES;
  2. If the message says the table does not exist, check whether the server provides it.
    SELECT COUNT(*) FROM information_schema.tables
    WHERE table_schema = 'performance_schema'
    AND table_name = 'replication_connection_status';
  3. A count of zero means Performance Schema was excluded when the server was built, or the version predates that table. There is nothing to change in Applications Manager; replication attributes cannot be collected from such a server.
  4. If the server takes no part in any replication setup, these messages are expected and can be ignored.

5.7 Too many connections

Error messageToo many connections
User '<user>' has exceeded the 'max_user_connections' resource (current value: N)

The server was reachable and answered, then refused the connection because it is already at its limit. Nothing is wrong with the host, the port or the credential. The monitor draws on the same pool as the applications using the database, so this usually appears first during a load peak and clears by itself afterwards.

  1. Find out which limit was reached, and how close the server normally runs to it.
    SHOW VARIABLES LIKE 'max_connections';
    SHOW VARIABLES LIKE 'max_user_connections';
    SHOW STATUS LIKE 'Threads_connected';
    SHOW STATUS LIKE 'Max_used_connections';
  2. If Max_used_connections sits at or near max_connections, the server is sized too small for its workload. Ask the DBA to raise the limit.
  3. To keep monitoring working even while the server is saturated, give the monitoring account a small allowance of its own.
    GRANT USAGE ON *.* TO '<monitoring-user>'@'<host>' WITH MAX_USER_CONNECTIONS 5;
  4. Raising the polling interval makes the monitor ask for a connection less often. Treat that as a stop-gap: it hides the symptom rather than addressing the limit.

5.8 Server stopped responding during a poll

Error messageThe last packet successfully received from the server was N milliseconds ago
Lost connection to MySQL server during query

This is not the same as section 4. There, the connection failed while it was being set up. Here it was already established and a query was in flight when the server stopped answering. Read the number in the message: it is how long the driver waited before giving up, and it points at what to look for.

  1. Check the server's own idle and packet limits.
    SHOW VARIABLES LIKE 'wait_timeout';
    SHOW VARIABLES LIKE 'interactive_timeout';
    SHOW VARIABLES LIKE 'max_allowed_packet';
  2. Read the MySQL error log for the time of the alert. A restart, a crash or an out-of-memory kill all reach the client as this message.
  3. If a firewall, NAT device or load balancer sits between the two hosts, confirm its idle timeout is longer than the monitor's polling interval. A device that silently drops an idle connection produces exactly this.
  4. If the failure lands on the same group of metrics every time rather than at random, that query is the slow one. Raise it with the DBA rather than extending timeouts.

5.9 Unknown system variable

Error messageUnknown system variable 'default_password_lifetime'

Applications Manager asked for a server variable this version does not have. It shows up while collecting password expiry details, which read default_password_lifetime — a variable MySQL added in 5.7.4 and MariaDB in 10.4.3. Against an older server that query fails and those attributes stay empty. No other metric is affected.

  1. Confirm the server version.
    SELECT VERSION();
  2. If the version predates those releases there is nothing to change. The server has no password expiry policy for the monitor to report.

5.10 Server time zone is not recognized

Error messageThe server time zone value '<zone>' is unrecognized or represents more than one time zone

This comes from the MySQL Connector/J driver, not from the MariaDB driver Applications Manager uses by default, so it appears only where the MySQL driver has been selected for the monitor. The server reports its time zone as an abbreviation that maps to more than one real zone, and the driver refuses to guess.

  1. See what the server reports.
    SELECT @@global.time_zone, @@session.time_zone;
  2. Ask the DBA to set an unambiguous value — a named zone or a fixed offset — rather than leaving it as SYSTEM.
    SET GLOBAL time_zone = '+05:30';
  3. To use named zones such as Asia/Kolkata, the server's time zone tables must be loaded first, with mysql_tzinfo_to_sql.
  4. Switching the monitor to the MariaDB driver also avoids this, since that driver does not perform the lookup.

5.11 Authentication plugin refused over an untrusted certificate

Error messageCannot use authentication plugin caching_sha2_password with a Self signed certificates. Either set sslMode=trust, use password with a MitM-Proof authentication plugin or provide server certificate to client

This is not the plugin being unsupported, which is what 5.1 covers. The driver supports caching_sha2_password and is refusing to use it. The connection is encrypted with a certificate the driver cannot verify - a self-signed one - and this plugin sends the password in a form that is only safe once the other end has been proved. Rather than send it to a server it cannot identify, the driver stops.

Upgrading the connector does not change this. A current connector behaves the same way, because the refusal is deliberate rather than a missing capability.

  1. Give Applications Manager the server's certificate, so the connection can be verified. This is the fix that keeps both the encryption and the plugin. Which truststore it goes into depends on the driver the monitor uses, shown on the monitor's Edit page under Driver for Server Connection:
    • MariaDB driver, which is the default: import into cacerts — Settings → Manage Certificates → Trust Certificates → Keystore/Truststore → select cacerts.
    • MySQL driver: import into AppManager_Home\working\Cert\apm.keystore.
    Restart Applications Manager afterwards. The full steps for both are in How to import certificates for monitoring MariaDB/MySQL DB Server with SSL authentication.
    Importing into the other store has no effect. Applications Manager passes apm.keystore to the MySQL driver only; with the MariaDB driver it leaves the trust anchors to the JVM default, which is cacerts. A certificate in the wrong store leaves this error exactly as it was.
  2. Or ask the DBA to move the monitoring user to an authentication plugin that does not require a verified certificate. Check what it uses now:
    SELECT user, host, plugin FROM mysql.user WHERE user = '<monitoring-user>';
  3. Clearing Force SSL on the monitor does not solve it. Without TLS the same plugin needs the server's public key instead, which is the first error in 5.1. It moves the problem rather than removing it, and it gives up the encryption on the way.

6. Still Facing Issues?

If the issue persists after following the troubleshooting steps above, contact the Applications Manager support team with the following details:

  • A screenshot of the MySQL Monitor Addition page.
  • The complete error message displayed while adding the monitor.
  • The MySQL server version.
  • The Applications Manager build number.
  • The hostname or IP address and port configured for the MySQL monitor.
  • The output of the connectivity test performed from the Applications Manager server.
  • The MySQL server error logs corresponding to the time of the connection failure.
  • The Applications Manager Support Information File (SIF).

                    New to ADSelfService Plus?

                      • Related Articles

                      • How can I upgrade the MySQL connector.jar?

                        Applies to: MySQL Database Server monitors that use the MySQL driver. Monitors using the bundled MariaDB driver need no connector file. Error messages MySQL Java Connector not found in the classpath. Invalid authorization specification, message from ...
                      • DNS Monitor - Troubleshooting

                        Common DNS Monitor Errors and Troubleshooting Guide 1. Host Not Found Description: The DNS server was unable to locate the requested lookup address. Possible Causes: This may happen if the hostname is incorrect, the domain does not exist, or there is ...
                      • Troubleshooting Oracle monitor connection failures

                        Applies to: Oracle Database Server and Oracle RAC monitors in ManageEngine Applications Manager. Problem: Oracle monitor addition or data collection fails with a connection-related error. When adding an Oracle Database Server monitor or ...
                      • Mail Server Monitor - Troubleshooting

                        Common Mail Server Monitor Errors and Troubleshooting Guide 1. Unknown Host Error Description: This error occurs when the mail client cannot resolve the hostname of the mail server to an IP address. The issue typically arises from DNS resolution ...
                      • Real User Monitor (RUM) - Troubleshooting guide

                        If your Real User Monitor has not collected data for an extended period, follow the steps below to troubleshoot the issue. Step 1: Verify the RUM Agent configuration Real User Monitoring requires the RUM Agent to be installed and mapped to ...