// MySQL error reference

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
Error message
Authentication plugin '%s' cannot be loaded: %s

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_sasl that the client doesn't ship.

How to fix it

  1. Upgrade the client library or driver to a version that supports caching_sha2_password. This is the proper fix.

  2. Check which plugin the account uses.

    SELECT user, host, plugin FROM mysql.user WHERE user = 'app';
  3. 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

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.