JDBC connection to MySQL fails with "java.sql.SQLInvalidAuthorizationSpecException: Access denied for user (using password: NO)"Issue Attempting to connect to a MySQL 8.0 or later server fails with a SQLInvalidAuthorizationSpecException, and the exception message includes “using password: NO” even though a password is provided CauseThe MySQL/MariaDB driver that ships with ServiceNow does not support the caching_sha_2 authentication plugin and attempting to authenticate as a user which uses the caching_sha_2 authentication plugin fails with the above exception (the using password: NO) part of the exception indicates that the password authentication plugin is unrecognized). This most commonly affects MySQL 8.0 and later, because starting with version 8.0.4, any newly created user account defaults to using the caching_sha_2 authentication plugin. This does not affect any version of MariaDB, only MySQL. Resolution Option 1 Change the authentication plugin used for the database user connecting MySQL to mysql_native_password. This can be done by creating a new user or altering the existing user on the MySQL Server, with the clause: IDENTIFIED WITH mysql_native_password BY 'new_password'. Refer to the MySQL documentation for CREATE/ALTER user for further details. Option 2 If using a MID server to connect to the database, use a different JDBC driver on the MID server. Any MariaDB Connect/J driver 2.5.0 or newer is known to work, as are more recent versions of the official MySQL Connect/J driver. Note that because MID ships with a MariaDB/MySQL driver already, the steps in KB0862383 must be followed to override the default driver. Also note that the caching_sha2_authentication plugin requires either a TLS connection or that the driver be configured to trust the server's RSA key, so additional configuration may be required to connect using TLS.