MySQL: Resolving MySQL error: "Authentication plugin 'caching_sha2_password' cannot be loaded"
This documentation is part of the Troubleshooting guide. You can view the complete guide here: MySQL common issues and solutions.
👋 Welcome to the Stackhero documentation!
Stackhero offers a fully managed MySQL cloud service that streamlines deployment and management for your production workloads:
- Unlimited connections and data transfers.
- Integrated phpMyAdmin web interface for simplified database management.
- Effortless updates with one-click upgrades.
- Consistent performance and enhanced security on a private, dedicated infrastructure.
With Stackhero, you have a reliable MySQL database ready within minutes. Reduce the time spent on installation and maintenance, and focus on developing your applications. Try MySQL cloud hosting on Stackhero today.
MySQL 8 defaults to using the caching_sha2_password authentication system. When working with older client libraries, you might encounter the error: "Authentication plugin 'caching_sha2_password' cannot be loaded". To resolve this, you can modify the default authentication method to use the MySQL native password.
In your Stackhero dashboard, navigate to the MySQL configuration section and select "MySQL native password" as the authentication plugin. This setting affects the root user and any newly created users.
For existing users (excluding the root user), you can execute the following commands using the MySQL command-line interface or phpMyAdmin:
USE mysql;
ALTER USER '<userToUpdate>'@'%' IDENTIFIED WITH mysql_native_password BY '<userPassword>';
FLUSH PRIVILEGES;