This guide needs root access, so it fits VPS and dedicated server customers.
What goes wrong?
MySQL keeps each user's password in a scrambled form. Scrambling is called hashing. Newer MySQL versions use a different way to scramble. Old programs may not understand the new way. Old accounts may also still hold the old form. After an upgrade, you may see errors like these:
Authentication plugin 'caching_sha2_password' cannot be loadedThe server requested authentication method unknown to the clientAccess denied for user
An authentication plugin is the part that checks a password. In MySQL 8, the default plugin is caching_sha2_password. Older apps and PHP versions expect mysql_native_password.
Warning: Take a backup of your databases before you change users. A mistake can lock your site out.
Steps
- Log in to your server with SSH. SSH is a safe way to type commands on a remote computer.
- Open MySQL as the admin:
mysql -u root -p - See how each user logs in:
This lists each user and its password plugin.SELECT user, host, plugin FROM mysql.user; - Find the user whose password fails.
- Switch that user to the older plugin and set the password again:
This tells MySQL to use the older method that old apps understand.ALTER USER 'myuser'@'localhost' IDENTIFIED WITH mysql_native_password BY 'NewStrongPassword'; - Reload the rights:
FLUSH PRIVILEGES; - Leave with
EXIT; - Test the login from your app or with
mysql -u myuser -p.
Remember to put the new password into your app's config file too. For WordPress, that is wp-config.php.
Make it the default for new users
If many users are affected, edit the MySQL config file. It is often /etc/my.cnf or /etc/mysql/my.cnf. Back it up first. Under [mysqld] add:



default_authentication_plugin=mysql_native_password
Then restart MySQL with systemctl restart mysqld (or mysql). In MySQL 8.4 and later this setting changed. Use authentication_policy instead, or fix users one by one.
Need help? Open a support ticket.
Quick recap
- Upgrades can change how passwords are checked.
- Look at the plugin column in
mysql.user. - Use
ALTER USER ... mysql_native_passwordto fix a user. - Update the password in your app's config.
- Back up first.