Skip to content

Update MariaDB to 11.8 - #1699

Merged
retlehs merged 1 commit into
masterfrom
update-mariadb-11.8
Nov 3, 2026
Merged

retlehs merged 1 commit into
masterfrom
update-mariadb-11.8

Conversation

@retlehs

@retlehs retlehs commented Nov 3, 2026

Copy link
Copy Markdown
Member

Updates the default MariaDB version from 10.11 to 11.8, the LTS release with the longest support window (until Feb 2030). MariaDB 10.11 has no packages for Ubuntu 26.04 (#1663) or Debian 13, so both need this change.

Changes

  • mariadb_version: "11.8": quoted so versions like 10.10 aren't parsed as the float 10.1.
  • Remove repos for other MariaDB versions. apt_repository names the sources file after the URL, which includes the version, so the previous bump (⬆️ Update MariaDB to 10.11 #1520) left the old and new repositories configured side by side.
  • Run mariadb-upgrade after install. MariaDB's packages try to run it on service start via /etc/mysql/debian-start, but that logs in as root without a password, which fails once Trellis sets a root password (FATAL ERROR: Upgrade failed in the journal). After a major upgrade the server ran 11.8 with system tables still marked 10.11. The new task is a no-op when the tables are already current.
  • Keep utf8mb4_general_ci as the default for tables created with a charset but no collation. MariaDB 11.2+ maps utf8mb4 to utf8mb4_uca1400_ai_ci via character_set_collations, even when collation-server is set. WordPress core tables aren't affected because core always sets utf8mb4_unicode_520_ci, but plugin tables created with only DEFAULT CHARSET utf8mb4 would get uca1400, and dumps containing it can't be imported into MySQL or older MariaDB. This setting is only rendered for 11.2+.

Existing servers

With the default apt_package_state: present, provisioning an existing server switches the repo to 11.8 but does not upgrade the installed 10.11 packages. To upgrade, back up the database first, then run:

trellis provision --tags mariadb --extra-vars "mariadb_server_package_state=latest mariadb_client_package_state=latest" production

To stay on 10.11, set mariadb_version: "10.11" in group_vars.

Testing

Tested on an Ubuntu 24.04 Lima VM with a restored WordPress database:

  • Provisioned on master (10.11.19), then provisioned this branch with the package states set to latest. The server went to 11.8.9, mariadb-upgrade ran (mariadb_upgrade_info reads 11.8.9), mariadb-check --all-databases reported every table OK, the 10.11 sources file was removed, and the front end and wp-login returned 200.
  • A second provision of the mariadb role changed nothing.
  • On 11.8, a table created with DEFAULT CHARSET utf8mb4 and no collation got utf8mb4_general_ci (it got utf8mb4_uca1400_ai_ci before this change).
  • pytest tests/templates and the playbook syntax checks pass.

A fresh install on 11.8 is covered by the integration workflow.

🤖 Generated with Claude Code

MariaDB 11.8 is the newest LTS with the longest support window (to
Feb 2030). 10.11 has no packages for Ubuntu 26.04 or Debian 13.

- Remove apt sources for other MariaDB versions so a version change
  doesn't leave both repositories configured
- Run mariadb-upgrade after install. The package's own upgrade check
  can't log in once Trellis sets a root password, which left system
  tables on the old version after a major upgrade
- Keep utf8mb4_general_ci as the default for tables created without a
  collation, so dumps still import into MySQL and older MariaDB
- Quote mariadb_version so versions like 10.10 aren't parsed as floats

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@retlehs
retlehs merged commit b5cf8c2 into master Nov 3, 2026
2 checks passed
@retlehs
retlehs deleted the update-mariadb-11.8 branch November 3, 2026 14:54
This was referenced Nov 3, 2026
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.

1 participant