Error
Error Code: 2059

MySQL Error 2059: Authentication Plugin Load Failure

📦 MySQL
📋

Description

This error indicates that MySQL, either the client or the server, failed to load a required authentication plugin. This typically occurs when the plugin's shared library file is missing, its path is incorrect, or there are insufficient permissions to access it, preventing successful user authentication.
💬

Error Message

Authentication plugin '%s' cannot be loaded: %s
🔍

Known Causes

4 known causes
⚠️
Missing or Corrupted Plugin File
The shared library file (.so or .dll) for the specified authentication plugin is either missing from the plugin directory or has become corrupted.
⚠️
Incorrect Plugin Path Configuration
MySQL cannot locate the authentication plugin because its installation path, or the `plugin_dir` system variable, is incorrectly configured.
⚠️
Insufficient File Permissions
The operating system user running MySQL (client or server) lacks the necessary read and execute permissions for the authentication plugin file.
⚠️
Incompatible Plugin Version
The authentication plugin version is incompatible with the MySQL server or client version, or it's not supported by the current architecture.
🛠️

Solutions

3 solutions available

1. Verify and Reinstall Plugin medium

Ensure the authentication plugin is correctly installed and accessible.

1
Identify the problematic plugin. The error message will specify the plugin name (e.g., 'caching_sha2_password').
2
Check if the plugin file exists in the MySQL plugin directory. The location can be found by querying `SHOW VARIABLES LIKE 'plugin_dir';`.
SHOW VARIABLES LIKE 'plugin_dir';
3
If the plugin file is missing or corrupted, you may need to reinstall it. This often involves rebuilding or re-compiling MySQL from source with the plugin enabled, or downloading and placing the correct plugin binary into the `plugin_dir`.
4
Alternatively, if the plugin is not critical, you can disable it. This might involve modifying the MySQL configuration file (`my.cnf` or `my.ini`) to comment out or remove any lines related to the plugin, or by altering the user's authentication method to a different, supported plugin.
[mysqld]
# plugin_load_add = "caching_sha2_password"
5
Restart the MySQL server after making any configuration changes.
sudo systemctl restart mysql

2. Update User's Authentication Method easy

Change the user's authentication plugin to a compatible one.

1
Connect to your MySQL server as a user with sufficient privileges (e.g., root).
mysql -u root -p
2
Identify the user account experiencing the authentication issue. You can list users with `SELECT user, host, plugin FROM mysql.user;`.
SELECT user, host, plugin FROM mysql.user;
3
Alter the user's authentication plugin to a widely supported one like `mysql_native_password` or `sha256_password`. Replace `'username'`, `'hostname'`, and `'new_password'` with the actual values. If you are unsure about the password, you may need to reset it.
ALTER USER 'username'@'hostname' IDENTIFIED WITH mysql_native_password BY 'new_password';
4
Flush privileges to ensure the changes are applied.
FLUSH PRIVILEGES;
5
Attempt to connect with the user account again.

3. Check MySQL Configuration for Plugin Loading medium

Ensure the MySQL server is configured to load the required authentication plugin.

1
Locate your MySQL configuration file. This is typically `my.cnf` on Linux/macOS or `my.ini` on Windows.
2
Open the configuration file in a text editor.
3
Look for a section like `[mysqld]` and check for directives related to plugin loading. Specifically, look for `plugin_load_add` or `plugin_dir`.
[mysqld]
plugin_dir = /usr/lib/mysql/plugin
plugin_load_add = "caching_sha2_password"
4
Ensure that the `plugin_dir` variable points to the correct directory where MySQL plugins are stored. Verify that the problematic plugin is listed in `plugin_load_add` if it's not a default plugin.
5
If you made any changes, save the configuration file and restart the MySQL server.
sudo systemctl restart mysql
🔗

Related Errors

5 related errors