Add database client auto-detection and version matching by AaronFeledy · Pull Request #212 · lando/php

Addresses MariaDB/MySQL client compatibility issues (lando/lando#3833) by detecting database services and installing matching clients for PHP 8.3+.

See examples/db-client/ for test scenarios.

Note

Medium Risk
Touches service build-step generation and Docker image contents; mistakes could break mysql/mysqldump availability or alter client behavior for PHP 8.3+ containers.

Overview
Adds database client auto-detection and installation for PHP 8.3+ services. builders/php.js now introduces a db_client option (default auto) that scans app services for mysql:*/mariadb:* and injects a root build step to install a matching client, with false to opt out or an explicit type:version override.

To support version-matched installs, PHP 8.3–8.5 image Dockerfiles now bundle pre-fetched MySQL 8.0 and 8.4 client binaries, and new helper scripts (install-db-client.sh, mysql-client-install.sh, mariadb-compat-install.sh) switch clients via symlinks/wrappers and write compatibility config. Docs and examples are updated, and example fixtures bump image tags from -6 to -7 plus a new examples/db-client scenario.

Written by Cursor Bugbot for commit 9b8084c. This will update automatically on new commits. Configure here.