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
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 usingcaching_sha2_passwordwhose 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
-
Connect with TLS, which every current client does by default.
-
If you can't use TLS, let the client fetch the server's RSA key:
--get-server-public-keyfor the mysql client, or the driver's equivalent (allowPublicKeyRetrieval=truein Connector/J). -
Log in once over TLS; the server then caches the hash and later non-TLS logins can succeed until the next restart.
Related errors
2059Authentication plugin cannot be loaded1251Client doesn't support auth protocol2026SSL connection error
More connection and client errors
2002Can't connect through socket2003Can't connect to MySQL server on host2005Unknown MySQL server host2006MySQL server has gone away2013Lost connection to MySQL server during query2055Lost connection to MySQL server at stage3159Insecure transport prohibited1158Error reading communication packets
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.
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.