Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

CLI variant fails connecting to MySql server via caching_sha2_password

未关闭
#862 0 条评论 7 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
55/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
停滞
技术栈
docker, docker-compose, mysql, php
领域
databases, devops

调研方向

检查建议位置附近的 Dockerfile.template,并将其与报告中的 Dockerfile workaround 进行比较。将 mariadb-connector-c 软件包添加到 wordpress:cli 镜像中,然后构建 CLI 变体并验证它能使用 caching_sha2_password 连接到 MySQL 8,且不会出现缺少插件的错误。

由索引模型根据 Issue 内容生成。

描述

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: https://github.com/arey/mysql-client/issues/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…

主要语言
Shell
星标
2k
派生
1.1k
PR 合并指标
30 天内没有已合并 PR

贡献指南

这个仓库没有索引到贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

docker-library/wordpress 的其他 Issue

查看 docker-library/wordpress 的全部 Issue

相似的 Issue

更多 Shell/Bash Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。