// MySQL error reference

MySQL error 2061: Authentication plugin reported error

The authentication plugin failed during login. With caching_sha2_password this is usually a request for a secure connection to send the password.

Error number
2061
Name
CR_AUTH_PLUGIN_ERR
Category
Connection and client
Error message
Authentication plugin '%s' reported error: %s

What it means

The client had the plugin but the plugin refused to go on. The most common text is Authentication requires secure connection. from caching_sha2_password: when the server has no cached hash for the account, the password must travel over TLS or be encrypted with the server's RSA public key, and the client was set up for neither.

Common causes

  • Connecting with TLS disabled (--ssl-mode=DISABLED) to an account using caching_sha2_password whose hash isn't cached yet, for example after a server restart.
  • A driver option that turns off TLS and doesn't allow fetching the server's public key.

How to fix it

  1. Connect with TLS, which every current client does by default.

  2. If you can't use TLS, let the client fetch the server's RSA key: --get-server-public-key for the mysql client, or the driver's equivalent (allowPublicKeyRetrieval=true in Connector/J).

  3. Log in once over TLS; the server then caches the hash and later non-TLS logins can succeed until the next restart.

Related errors

More connection and client errors

The code and message text are from the MySQL 8.4 Error Message Reference. Browse the full MySQL error list or search every database error.

// fewer errors, faster fixes

Work on MySQL in SQLly

A native SQL client for macOS, Windows and Linux with schema-aware IntelliSense, guardrails for risky statements and clear error messages, for MySQL and the other databases you use.