Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CLI variant fails connecting to MySql server via caching_sha2_password #862

Open
febsn opened this issue Nov 29, 2023 · 0 comments
Open

Comments

@febsn
Copy link

febsn commented Nov 29, 2023

I'm using a docker-compose setup consisting of a mysql:8.0, a wordpress:6 and a wordpress:cli container. Wordpress itself works fine, but the CLI failed to connect to the server saying:

Failed to get current SQL modes. Reason: 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

I dug deeper and found out that the underlying php:8.x-alpine image doesn't seem to include the necessary libraries per default, but they can be added by installing the mariadb-connector-c package (see: arey/mysql-client#5)

I can confirm; it now works, using the following hacky Dockerfile for the cli:

FROM wordpress:cli

USER root
RUN apk add --no-cache mariadb-connector-c

USER www-data

I'd suggest that the package be included in the wordpress:cli variant. Supposedly it could be added in https://github.com/docker-library/wordpress/blob/master/Dockerfile.template after line 17 – I don't feel competent enough for a PR…

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant