How to fix MySQL connection error: Authentication plugin ‘caching_sha2_password’ cannot be loaded: dlopen(/usr/local/mysql/lib/plugin/caching_sha2_password.so, 2): image not found

The problem is some MySQL clients not yet support new password encryption method.

 

Just change the user password encryption back to legacy version, then problem will be fixed.

The following SQL update specific user to legacy encryption:

 

Also, you can change the default authentication plugin to legacy version.

Update /etc/my.cnf and add the following line after [mysqld]: