Authentication
The following error message means you are attempting to connect to MySQL using an application or a version 5.x client that does not support the caching_sha2_password
.
ER_NOT_SUPPORTED_AUTH_MODE: Client does not support authentication protocol requested by server; consider upgrading MySQL client
Copy
If you are getting this error using a PHP based application to connect to the database, this solution only works for applications using PHP 7.2 or higher. DigitalOcean Managed Databases using MySQL 8+ are automatically configured to use caching_sha2_password
authentication by default. caching_sha2_password
uses a stronger password encryption than prior versions of MySQL and PHP based applications using PHP 7.1 or older do not support MySQL 8+ password encryption. If your applications are experiencing authentication issues, you can use the Password Encryption option in the control panel to set a user’s password encryption settings to MySQL 5.x encryption settings.
Alternatively, you can connect using MySQL 8.x and issue the following statement, which will change the password type the server will accept for the current user. Replace use_your_user
with your MySQL username, and replace use_your_password
with the user’s current password. After successfully executing the statement, you should be able to connect to MySQL with a 5.x client or an application that does not support caching_sha2_password
:
" style="box-sizing: border-box; font-family: monospace, serif; font-size: 13.6px; border-radius: 2px; white-space: pre; background: inherit; border: 0px; padding: 0px; margin: 0px; color: rgb(103, 103, 103); direction: ltr; text-align: left; word-spacing: normal; word-break: normal; line-height: 1.4em; tab-size: 2; hyphens: none;">ALTER USER use_your_user IDENTIFIED WITH mysql_native_password BY 'your_password';