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.
Underlying driver errors: Socket fail to connect to ... · Read timed out · Socket timeout when connecting
Possible causes:
Troubleshooting steps:
nslookup <mysql-host>Windows: Test-NetConnection <mysql-host> -Port <mysql-port>
Linux: nc -vz <mysql-host> <mysql-port>bind-address configuration. If the server is listening only on 127.0.0.1, remote connections may not be accepted.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.
Driver error behind it: Host '<address>' is not allowed to connect to this MySQL server → go to 2.1.
Driver error behind it: Access denied for user '<user>'@'<host>' (using password: YES) → go to 2.2.
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:
SELECT user, host
FROM mysql.user
WHERE user = '<monitoring-user>';host column with the address in the error message. If no row matches it, the account for that address does not exist.CREATE USER '<monitoring-user>'@'<appmanager-address>' IDENTIFIED BY '<password>';GRANT SELECT, SHOW DATABASES, REPLICATION CLIENT, PROCESS
ON *.*
TO '<monitoring-user>'@'<appmanager-address>';
FLUSH PRIVILEGES;'<monitoring-user>'@'10.0.0.%', is acceptable in your environment. Grant the narrowest range that covers the host.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.
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:
SELECT user, host FROM mysql.user WHERE user = '<monitoring-user>';%, 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.mysql -h <the address shown in the error message> -P <mysql-port> -u <monitoring-user> -plocalhost 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.SELECT user, host, plugin
FROM mysql.user
WHERE user = '<monitoring-user>';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.
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.
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.
SELECT user, host, account_locked, password_expired
FROM mysql.user
WHERE user = '<monitoring-user>';ALTER USER '<monitoring-user>'@'<host>' ACCOUNT UNLOCK;ALTER USER '<monitoring-user>'@'<host>' PASSWORD EXPIRE NEVER;Underlying driver error: Unknown database 'X'
Possible causes:
Troubleshooting steps:
SHOW DATABASES;Underlying driver error: Connection reset
Possible causes:
Troubleshooting steps:
SHOW VARIABLES LIKE 'require_secure_transport';If the following errors are encountered while adding the monitor:
Public Key Retrieval is not allowedClient does not support authentication protocol requested by serverInvalid 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.
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.
Connections using insecure transport are prohibited while --require_secure_transport=ON
SHOW VARIABLES LIKE 'require_secure_transport';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.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.
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';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.
cacerts — Settings → Manage Certificates → Trust Certificates.AppManager_Home\working\Cert\apm.keystore.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.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.
SHOW VARIABLES LIKE 'tls_version';TLSv1 or TLSv1.1, ask the DBA to include TLSv1.2. The server needs a restart for the change to take effect.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.
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.
SHOW VARIABLES LIKE 'character_set_server';
SHOW VARIABLES LIKE 'collation_server';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.
GRANT REPLICATION CLIENT ON *.* TO '<monitoring-user>'@'<host>';
GRANT SELECT ON performance_schema.* TO '<monitoring-user>'@'<host>';
FLUSH PRIVILEGES;SELECT COUNT(*) FROM information_schema.tables
WHERE table_schema = 'performance_schema'
AND table_name = 'replication_connection_status';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.
SHOW VARIABLES LIKE 'max_connections';
SHOW VARIABLES LIKE 'max_user_connections';
SHOW STATUS LIKE 'Threads_connected';
SHOW STATUS LIKE 'Max_used_connections';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.GRANT USAGE ON *.* TO '<monitoring-user>'@'<host>' WITH MAX_USER_CONNECTIONS 5;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.
SHOW VARIABLES LIKE 'wait_timeout';
SHOW VARIABLES LIKE 'interactive_timeout';
SHOW VARIABLES LIKE 'max_allowed_packet';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.
SELECT VERSION();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.
SELECT @@global.time_zone, @@session.time_zone;SYSTEM.
SET GLOBAL time_zone = '+05:30';Asia/Kolkata, the server's time zone tables must be loaded first, with mysql_tzinfo_to_sql.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.
cacerts — Settings → Manage Certificates → Trust Certificates → Keystore/Truststore → select cacerts.AppManager_Home\working\Cert\apm.keystore.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.SELECT user, host, plugin FROM mysql.user WHERE user = '<monitoring-user>';If the issue persists after following the troubleshooting steps above, contact the Applications Manager support team with the following details: