Symptoms
Attempting to access phpMyAdmin returns the following error:
mysqli_connect(): (HY000/2059): Authentication plugin 'caching_sha2_password'
cannot be loaded: /usr/local/cpanel/3rdparty/lib/plugin/caching_sha2_password.so:
cannot open shared object file: No such file or directory
Description
When installing MySQL 8, cPanel enables the authentication plugin mysql_native_password as the default plugin for logins. If this configuration is changed to the caching_sha2_password at any point in time, it will cause issues with cPanel related applications due to not supporting this functionality.
Workaround
The user password needs to be reset manually to address the concern.
- Enter MySQL CLI, then the following command.
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password';
flush privileges;
Note: Replace the 'password' with the new password ( the single quotes are required ).
- Ensure the following line exist under the [mysqld] section of /etc/my.cnf configuration file
default-authentication-plugin=mysql_native_password
- Restart MySQL
/scripts/restartsrv_mysql
At this point, WHM can manage password resets for the root user successfully. Resetting the password in WHM will allow the cPanel apps passwords to sync, resolving the issue with accessing phpMyAdmin. If you reset the password to the same existing password in the alter user command, phpMyAdmin should usually work without the additional password reset in WHM.