About this article: This article is reviewed against the cited sources. This is source research, not lab validation. Check the stated versions and your own requirements before making changes.
The message Authentication plugin 'caching_sha2_password' cannot be loaded comes from the client side of the connection, not from the server. The program or library that is connecting does not have the plugin that MySQL 8 uses by default. The MySQL 8.0 manual's remedy is to "relink clients against libmysqlclient from MySQL 8.0 or higher, or obtain an updated connector that recognizes caching_sha2_password". Find which client is old, then upgrade it.
What the error means
The client error reference lists error 2059, symbol CR_AUTH_PLUGIN_CANNOT_LOAD, with the message format Authentication plugin '%s' cannot be loaded: %s. The second part varies by platform. The 8.0 manual shows one such form: Authentication plugin 'caching_sha2_password' cannot be loaded: dlopen(/usr/local/mysql/lib/plugin/caching_sha2_password.so, 2): image not found.
Since MySQL 8.0, caching_sha2_password is the preferred and default authentication plugin. The 8.0 manual says the change applies to new accounts created after installing or upgrading, while accounts that already existed keep their plugin. In 8.4 the manual says caching_sha2_password is the default instead of mysql_native_password, which it marks deprecated. It adds that mysql_native_password is "disabled by default in MySQL 8.4" and "removed as of MySQL 9.0.0".
The 8.0 manual also says why even an account that does not use the new plugin can fail. The server tells the client the name of its default plugin. A client or connector built on a protocol implementation that does not handle an unknown default plugin "may fail with an error such as one of these". Its list includes the message in the title (with a platform-specific reason after the colon), Authentication plugin 'caching_sha2_password' is not supported, and a PHP warning that begins Warning: mysqli_connect(): The server requested authentication method unknown to the client [caching_sha2_password].
The manual separates this from two other things:
- A client that knows the plugin but connects without encryption and without an RSA public key gets
ERROR 2061 (HY000): Authentication plugin 'caching_sha2_password' reported error: Authentication requires secure connection.That is a connection-security problem, not a missing plugin. - On an 8.4 server where
mysql_native_passwordstays disabled, accounts that use it getERROR 1045 (28000): Access denied for userwhen they connect, andCREATE USERorALTER USERnaming that plugin returnsERROR 1524 (HY000): Plugin 'mysql_native_password' is not loaded.
Likely causes
| Cause | What you see | How to confirm |
|---|---|---|
| Client library or connector older than MySQL 8.0, or one that does not know the plugin | The message in the title, or "is not supported", on connect | The client's version: mysql --version for the command-line client, the driver's own version for an application |
| Account created after the upgrade, so it uses the new default plugin | Old applications fail only for the new account | plugin column for that account in mysql.user |
| Client built on a protocol implementation that cannot handle the server's default plugin name | Fails even for an account on mysql_native_password (8.0 manual) |
Same account works from the official mysql client on the server |
| Connection is unencrypted and no RSA key is available | ERROR 2061, not the title message | The exact message; the client knows the plugin |
mysql_native_password disabled on an 8.4 server |
ERROR 1045 for accounts that use it, and ERROR 1524 when naming it in CREATE USER or ALTER USER |
The account's plugin value is mysql_native_password, and the server was started without --mysql-native-password=ON |
Prove the cause before changing anything
All of these are read-only.
1. Which client, and which version?
mysql --version
The manual lists --version (-V) as displaying version information. For an application, find the driver or connector version in the application's dependency list or its package manager. A client older than MySQL 8.0 is the likely cause.
2. Which server version and default?
SELECT VERSION();
SHOW VARIABLES LIKE 'authentication_policy';
On 8.4 the manual's default for authentication_policy is *,,, with caching_sha2_password the default plugin for the first factor. On an 8.0 server, the equivalent variable is default_authentication_plugin; the 8.4 variable reference has no entry for it.
3. Which plugin does the account use?
SELECT user, host, plugin FROM mysql.user WHERE user = 'appuser';
The manual says the plugin name is stored in the plugin column of mysql.user. This needs the privileges to read that table. If the plugin is caching_sha2_password and the client is old, the cause is confirmed.
4. Does the official client connect?
From the database server, run the current mysql client against the same account, using its -u and -p options. If that connects, the server and account are fine and the application's client is the problem.
Fix
Upgrade the client or connector
This is the manual's own remedy and it does not weaken the server. Rebuild the application against libmysqlclient from MySQL 8.0 or higher, or install a connector that recognises caching_sha2_password. Where a connector has its own build modes, the 8.0 manual notes that MySQL Connector/Python's C extension is libmysqlclient-based and is used with use_pure=False.
First save the current client version and a copy of the file that lists the application's dependencies. Replace <dependency_file> with that file's name:
mysql --version
cp -p <dependency_file> <dependency_file>.2026-11-22
The cp manual describes -p as the same as --preserve=mode,ownership,timestamps. Keep the mysql --version output; for the application's own driver, note the version from its package listing.
Risk: the next step replaces the database driver in the application's installation; do it first on a staging copy, because character handling or timeouts can change with a new driver.
Install the newer connector on the staging copy and run the application's connection test.
To undo it: reinstall the version you noted, check that the saved copy exists with ls -l <dependency_file>.2026-11-22, then put it back under its original name with cp -p <dependency_file>.2026-11-22 <dependency_file>, then run the same connection test.
Server option file (temporary; on 8.4 this comes first)
For an 8.0 server the manual's example is default_authentication_plugin=mysql_native_password in the [mysqld] section, described as a way to let pre-8.0 clients connect "until such time as the clients and connectors in use at your installation are upgraded". For 8.4 the manual says to start the server with --mysql-native-password=ON, or put mysql_native_password=ON in [mysqld]. On an 8.4 server the next section's ALTER USER works only once the plugin is enabled this way. The 8.0 manual says the setting affects "new accounts created with the setting in effect". This setting changes the default for accounts created afterwards; an existing account keeps its plugin until you change it in the next section.
First find the option file the server reads. The manual says that for mysqld you run it with --verbose and --help, and the help message "indicates which files it looks for". Of those files, edit the one that holds your [mysqld] settings; on Unix the manual lists /etc/my.cnf and /etc/mysql/my.cnf among the candidates.
mysqld --verbose --help
Then save that file. Replace <option_file> with the file you found. First check that it exists:
ls -l <option_file>
If it does not exist, stop: there is nothing to save, and this step needs an existing file. If it exists, save it:
cp -p <option_file> <option_file>.2026-11-22
Disruptive step: the next change takes effect when the MySQL service restarts, which disconnects every session. Schedule it for a quiet window.
Add the line for your version under [mysqld] of that file. For an 8.0 server:
default_authentication_plugin=mysql_native_password
For an 8.4 server:
mysql_native_password=ON
Then check the configuration before restarting:
mysqld --validate-config
The manual says the server terminates with an exit code of 0 if no errors are found. Then restart the MySQL service with your platform's tool; the service name differs between installations, so use the name your platform lists.
To undo it: first prove the saved copy exists with ls -l <option_file>.2026-11-22. Only then put it back under its original name and check it:
cp -p <option_file>.2026-11-22 <option_file>
mysqld --validate-config
After the copy and the check succeed, restart the MySQL service the same way as above.
Switch one account to mysql_native_password (temporary)
The manual treats reverting to the old plugin as temporary. It also says the setting "causes new accounts created with the setting in effect to forego the improved authentication security".
First save the account's current plugin:
SELECT user, host, plugin FROM mysql.user WHERE user = 'appuser' AND host = '192.0.2.20';
Risk: the next statement changes how the account appuser@192.0.2.20 logs in and sets a new password hash, so the password you supply must be the one the applications already use. The manual states that IDENTIFIED WITH with BY "passes the cleartext" value to the plugin for hashing.
Run, using the real password in place of the placeholder:
ALTER USER 'appuser'@'192.0.2.20' IDENTIFIED WITH mysql_native_password BY '<password>';
The MySQL 8.0 upgrade page says clients and connectors not updated for caching_sha2_password "may have trouble connecting" to a server whose default plugin is that, "even to use accounts that do not authenticate with caching_sha2_password". Switching this account may therefore not fix such a client. Test before relying on it.
To undo it: if the saved plugin was caching_sha2_password, run the statement below with the same password.
ALTER USER 'appuser'@'192.0.2.20' IDENTIFIED WITH caching_sha2_password BY '<password>';
Then run the saved SELECT again. The plugin column should equal the saved value.
Example (illustrative): web01 runs an application whose connector dates from the MySQL 5.7 era. After db01 moves to MySQL 8.0, a new account appuser@192.0.2.20 fails with Authentication plugin 'caching_sha2_password' cannot be loaded. mysql --version on web01 shows a 5.7 client. SELECT user, host, plugin FROM mysql.user WHERE user = 'appuser'; shows caching_sha2_password. The official client from db01 connects with the same account. The team installs a current connector on a staging copy of web01, the connection test passes, and the connector is rolled out. The account plugin is left as it was.
Confirm the fix
- The application connects with the account and runs a simple query.
- The
plugincolumn for the account is the one you intended. - If you edited the option file, the service has restarted and the account test above succeeds.
- The error log has no new authentication errors for that account.
What to watch afterwards
- Any new account created now gets the server's default plugin. List the accounts that still use
mysql_native_password; the manual says it is deprecated and removed as of MySQL 9.0.0. - Upgrading MySQL again may change the default for new accounts. Check old clients before each upgrade.
- Keep a list of every application and the connector version it uses, so a database upgrade does not turn into a search.
Read next
Related articles you may want next.
- TroubleshootingMySQL ERROR 1045 (28000) "Access denied for user": which account the server matchedMySQL ERROR 1045 (28000) Access denied for user? Read the user, host and 'using password' text, find the account the server matched, then fix it.Read article
- TroubleshootingMySQL ERROR 2002 "Can't connect to local MySQL server through socket": is it running, and which socketMySQL ERROR 2002 'Can't connect to local MySQL server through socket'? Check mysqld is running, find the real socket path, and fix the client.Read article
- TroubleshootingWordPress "Error establishing a database connection": check wp-config, then the database serverWordPress 'Error establishing a database connection': check DB_NAME, DB_USER, DB_PASSWORD and DB_HOST, then test the database server with mysqladmin ping.Read article
Risks and limits
- These commands have not been run or lab-tested.
- The MySQL 8.4 manual does not say how a client that cannot handle an unknown default plugin behaves against an 8.4 server. The explanation of that failure is on the 8.0 page.
- Password-reset statements need the real password. Do not paste a password into a ticket or a shared document.
- This applies to the Oracle MySQL server and its client library. MariaDB and other forks use different authentication plugin names and are not covered.
Sources
- MySQL 8.4 Reference Manual: Caching SHA-2 Pluggable Authentication — Oracle, no date shown, accessed 22 November 2026
- MySQL 8.4 Reference Manual: Native Pluggable Authentication — Oracle, no date shown, accessed 22 November 2026
- MySQL 8.0 Reference Manual: Changes in MySQL 8.0 (caching_sha2_password as the Preferred Authentication Plugin) — Oracle, no date shown, accessed 22 November 2026
- MySQL 8.0 Reference Manual: Server System Variables (default_authentication_plugin) — Oracle, no date shown, accessed 22 November 2026
- MySQL 8.4 Reference Manual: Server System Variables (authentication_policy) — Oracle, no date shown, accessed 22 November 2026
- MySQL 8.4 Reference Manual: ALTER USER Statement — Oracle, no date shown, accessed 22 November 2026
- MySQL 8.4 Reference Manual: Using Option Files — Oracle, no date shown, accessed 22 November 2026
- cp(1) — GNU coreutils 9.11 manual page, April 2026, accessed 22 November 2026
- MySQL 8.4 Reference Manual: Server Command Options (--validate-config, --verbose --help) — Oracle, no date shown, accessed 22 November 2026
- MySQL 8.4 Reference Manual: mysql Client Options — Oracle, no date shown, accessed 22 November 2026
- MySQL Error Reference: Client Error Message Reference — Oracle, no date shown, accessed 22 November 2026
This article was originally published on .