When connecting to MySQL I get an authentication error
Authentication errors occur when you attempt to connect to MySQL using an application like MySQL Workbench or a version 5.x client that does not support the caching_sha2_password
.
If you are getting one of these errors using a PHP-based application to connect to the database, the following solution only works for applications using PHP 7.2 or higher. Set the user’s password encryption settings to MySQL 5.x encryption settings, using the Password Encryption option in the control panel.
Otherwise, you can use the following solution to connect to MySQL with a 5.x client or an application that does not support caching_sha2_password
. Connect using MySQL 8.x and issue the following statement, which changes 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:
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.