Authentication plugin ‘caching_sha2_password’ error v2

If you encounter the following error:

ERROR:  failed to connect to MySQL: Authentication plugin ‘caching_sha2_password’ cannot be loaded: /usr/lib64/mysql/plugin/caching_sha2_password.so: cannot open shared  object file: No such file or directory

Specify the authentication plugin as mysql_native_password and set a cleartext password value. The syntax is:

ALTER USER 'username'@'host' IDENTIFIED WITH mysql_native_password BY '<password>';

Note

See the MySQL 8 documentation for more details on this error.