WP images ship with a mysql client that is assembled from MariaDB sources and doesn't have support for caching_sha2_password.
$ mysql -V
mysql Ver 15.1 Distrib 10.11.8-MariaDB, for Linux (x86_64) using readline 5.1
This is because MariaDB Server does not currently support caching_sha2_passwordas documented here.
When using mysql 8.0+ as the server, and running wp db cli for example, we get this error:
ERROR 1045 (28000): Plugin caching_sha2_password could not be loaded: Error loading shared library /usr/lib/mariadb/plugin/caching_sha2_password.so: No such file or directory
This is because mysql 8.0+ uses caching_sha2_password as it's default authentication plugin as documented here: _In MySQL 8.0, caching_sha2_password is the default authentication plugin rather than mysql_nativepassword.
I found PR #902 regarding the issue. Installing that package likely fixes the issue because it provides the caching_sha256_password plugin, which is compatible with MySQL's caching_sha2_passwordas documented here.
@tianon I am unsure if that would actually be a robust fix, but here's the issue explained more in detail.
WP images ship with a mysql client that is assembled from MariaDB sources and doesn't have support for
caching_sha2_password
.This is because MariaDB Server does not currently support
caching_sha2_password
as documented here.When using mysql 8.0+ as the server, and running
wp db cli
for example, we get this error:This is because mysql 8.0+ uses
caching_sha2_password
as it's default authentication plugin as documented here: _In MySQL 8.0,caching_sha2_password
is the default authentication plugin rather than mysql_nativepassword.I found PR #902 regarding the issue. Installing that package likely fixes the issue because it provides the
caching_sha256_password
plugin, which is compatible with MySQL'scaching_sha2_password
as documented here.@tianon I am unsure if that would actually be a robust fix, but here's the issue explained more in detail.