Skip to content

SE2-752/add caching_sha2_password support for MySQL 8.4#15

Merged
rick-lam merged 1 commit into
mainfrom
SE2-752/add-caching-sha2-password-support
May 7, 2026
Merged

SE2-752/add caching_sha2_password support for MySQL 8.4#15
rick-lam merged 1 commit into
mainfrom
SE2-752/add-caching-sha2-password-support

Conversation

@rick-lam
Copy link
Copy Markdown
Contributor

Summary

  • Bump runtime base from graze/php-alpine:7.3 to graze/php-alpine:7.4mysqlnd in 7.4 has auth_plugin_caching_sha2_password built in, unlike the Alpine 3.9 / PHP 7.3 build.
  • Add mariadb-connector-c so the mysql CLI can load caching_sha2_password.so.
  • Composer platform constraint stays at 7.3 (composer.json unchanged); vendor code runs unmodified on 7.4.

Why now

MySQL 8.4 (being rolled out under SE2-752) removes mysql_native_password as a default plugin and mandates caching_sha2_password. The current graze/sprout:latest fails on both code paths when talking to 8.4:

  • PHP PDO/mysqli: SQLSTATE[HY000] [2054] The server requested authentication method unknown to the client — mysqlnd in the old base lacks the plugin.
  • Shell-outs to mysql CLI (used by sprout chop/seed): ERROR 1045 (28000): Plugin caching_sha2_password could not be loaded — plugin file not shipped.

Both are fixed by this PR.

Test plan

  • make build && make build-docker succeeds.
  • php -r phpinfo() in the built image shows auth_plugin_caching_sha2_password in mysqlnd plugins.
  • /usr/lib/mariadb/plugin/caching_sha2_password.so is present.
  • PDO connect against a MySQL 8.4 server using caching_sha2_password succeeds.
  • mysql CLI connect against the same server succeeds.
  • End-to-end: make db-data-web / db-data-dispatch in the web repo (which invokes sprout chop + seed against mysql:8.4) completes with exit 0 and zero auth errors.
  • Verify existing integ/staging/uat sprout configs still parse (no config-shape changes in this PR, but re-check).

🤖 Generated with Claude Code

Copilot AI review requested due to automatic review settings April 24, 2026 14:55
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the runtime Docker image to support MySQL 8.4’s default caching_sha2_password authentication for both PHP (mysqlnd) connections and mysql CLI shell-outs used by sprout commands.

Changes:

  • Bump runtime base image from graze/php-alpine:7.3 to graze/php-alpine:7.4 to pick up mysqlnd support for caching_sha2_password.
  • Install mariadb-connector-c alongside mariadb-client so the mysql CLI can load the caching_sha2_password client plugin.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@rick-lam rick-lam force-pushed the SE2-752/add-caching-sha2-password-support branch from bee1a7f to 5d536cf Compare May 6, 2026 21:08
@rick-lam rick-lam force-pushed the SE2-752/add-caching-sha2-password-support branch from 84c5e39 to 302806b Compare May 7, 2026 09:52
MySQL 8.4 makes caching_sha2_password the mandatory default auth plugin
and disables mysql_native_password. The sprout image could not connect
to 8.4 servers because:

- graze/php-alpine:7.3 mysqlnd was compiled without
  auth_plugin_caching_sha2_password, causing PDO/mysqli connects to
  fail with "The server requested authentication method unknown to the
  client [caching_sha2_password]".
- The Alpine mysql/mariadb-client did not ship the
  caching_sha2_password.so plugin, so shell-outs to the mysql CLI
  failed with "ERROR 1045 (28000): Plugin caching_sha2_password could
  not be loaded".

Bump runtime base to graze/php-alpine:7.4 (mysqlnd has caching_sha2
built in) and install mariadb-connector-c (provides the CLI plugin).
Composer platform stays at 7.3; vendor code runs unchanged on 7.4.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@rick-lam rick-lam force-pushed the SE2-752/add-caching-sha2-password-support branch from 302806b to 631bdc6 Compare May 7, 2026 11:04
@rick-lam rick-lam merged commit 004b914 into main May 7, 2026
7 checks passed
@rick-lam rick-lam deleted the SE2-752/add-caching-sha2-password-support branch May 7, 2026 11:06
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

Successfully merging this pull request may close these issues.

2 participants