MySQL error 2059: Authentication plugin cannot be loaded
The account uses an authentication plugin the client library doesn't have, typically caching_sha2_password with an older client or connector.
- Error number
2059- Name
CR_AUTH_PLUGIN_CANNOT_LOAD- Category
- Connection and client
What it means
Each MySQL account has an authentication plugin. Since MySQL 8.0 the default is caching_sha2_password. A client library that doesn't include that plugin (older libmysqlclient, older MariaDB clients, some older drivers) can't complete the login and reports 2059 with the plugin name.
Common causes
- Connecting to MySQL 8.0 or later with a client or connector built for MySQL 5.7 or earlier.
- A MariaDB client library talking to MySQL 8 without the plugin installed.
- The account was created with a plugin such as
authentication_ldap_saslthat the client doesn't ship.
How to fix it
-
Upgrade the client library or driver to a version that supports
caching_sha2_password. This is the proper fix. -
Check which plugin the account uses.
SELECT user, host, plugin FROM mysql.user WHERE user = 'app';
-
If you can't upgrade the client, switch that account to
mysql_native_password, where your server still supports it. It is deprecated in MySQL 8.0 and disabled by default in 8.4.ALTER USER 'app'@'%' IDENTIFIED WITH mysql_native_password BY 'password';
Related errors
1251Client doesn't support auth protocol2061Authentication plugin reported error1045Access denied for user
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 stage2026SSL connection error3159Insecure transport prohibited
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.