Skip to content

fix: MariaDB --defaults-file TLS/SSL error (Drush sql:*) - #253

Open
AaronFeledy wants to merge 4 commits into
mainfrom
cursor/mariadb-defaults-file-ssl-f154
Open

AaronFeledy wants to merge 4 commits into
mainfrom
cursor/mariadb-defaults-file-ssl-f154

Conversation

@AaronFeledy

@AaronFeledy AaronFeledy commented Sep 17, 2026 •

Copy link
Copy Markdown
Member

MariaDB 11 clients require TLS by default. lando.cnf already sets disable-ssl-verify-server-cert, but callers that pass --defaults-file (Drush sql:*, site:install) skip it and fail against non-TLS servers with:

ERROR 2026 (HY000): TLS/SSL error: SSL is required, but the server does not support it

mariadb-compat-install.sh now installs /usr/local/bin wrappers for mariadb, mariadb-admin, mariadb-dump, mariadb-check, mariadb-import and mariadb-show. Each wrapper keeps any leading --no-defaults, --print-defaults and --defaults-*= args first, then adds --skip-ssl-verify-server-cert, then the caller's args. The existing mysql* name wrappers resolve to these. A wrapper is only written when the client's --help lists --ssl-verify-server-cert, and the script only runs for MariaDB clients, so MySQL clients are untouched. Rebuild-only.

The db-client example adds a MariaDB 10.6 service (no TLS), confirms the bare client fails with ERROR 2026 via --defaults-file, and checks that the wrapped mariadb, mysql, mariadb-dump, mysqldump and mariadb-admin connect.

Closes #252


Note

Medium Risk
Changes how MariaDB CLI binaries behave in PHP containers (database access and tooling like Drush); scope is limited to MariaDB client install and requires a rebuild.

Overview
Fixes MariaDB 11 client ERROR 2026 when CLI tools use --defaults-file and skip lando.cnf—a common path for Drush sql:* against local non-TLS MariaDB servers.

mariadb-compat-install.sh now installs /usr/local/bin wrappers for mariadb, mariadb-admin, mariadb-dump, and related binaries. Each wrapper keeps leading --defaults-* / --no-defaults arguments in order, then adds --skip-ssl-verify-server-cert, then forwards the rest of the argv. Wrappers are only created when --help advertises SSL verify options; existing mysql* → mariadb* name aliases still apply and pick up the wrapped clients via PATH.

Docs and examples note the TLS caveat, changelog entry for #252, and the db-client example adds a MariaDB 10.6 (no TLS) service plus checks that bare /usr/bin/mariadb --defaults-file fails while wrapped clients succeed.

Reviewed by Cursor Bugbot for commit c494170. Bugbot is set up for automated code reviews on this repo. Configure here.

Co-authored-by: Aaron Feledy <AaronFeledy@users.noreply.github.com>
@netlify

netlify Bot commented Sep 17, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for lando-php ready!

Name Link
🔨 Latest commit c494170
🔍 Latest deploy log https://app.netlify.com/projects/lando-php/deploys/6b11a6f79ee83b54d2bcdc09
😎 Deploy Preview https://deploy-preview-253--lando-php.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 93 (🟢 up 2 from production)
Accessibility: 98 (no change from production)
Best Practices: 100 (no change from production)
SEO: 100 (no change from production)
PWA: -
View the detailed breakdown and full score reports
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

cursoragent and others added 3 commits September 17, 2026 21:57
Co-authored-by: Aaron Feledy <AaronFeledy@users.noreply.github.com>
# Conflicts:
#	CHANGELOG.md
@AaronFeledy
AaronFeledy marked this pull request as ready for review December 3, 2026 17:35
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.

MariaDB 11 client TLS breaks Drush/--defaults-file (ERROR 2026)

2 participants