From 678859f8efbf1cf5d208eaa75a1ba2344ce12933 Mon Sep 17 00:00:00 2001 From: Blai Peidro Date: Tue, 17 Nov 2026 04:15:27 +0100 Subject: [PATCH] feat: MySQL 9.7 LTS, the LTS after 8.4 The compose file runs mysql:9.7.4 ; my.cnf no longer turns on mysql_native_password, which MySQL 9 removed and refuses to start with. The README says how a setup on 8.4 moves : back up, move the users still on mysql_native_password, drop that line, start again. Dependabot keeps 9.7 patched on main, 8.4 on v6. --- .github/dependabot.yml | 6 +++--- README.md | 17 +++++++++++++++++ data/mysql/my.cnf | 1 - docker-compose.yml | 2 +- 4 files changed, 21 insertions(+), 5 deletions(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 4ef3e66..a3dc638 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -17,7 +17,7 @@ updates: prefix: build include: scope ignore: - # MySQL stays on its LTS line (8.4) : its patches only. Dependabot cannot tell an LTS + # MySQL stays on its LTS line (9.7) : its patches only. Dependabot cannot tell an LTS # release from an innovation one, so moving to the next LTS is done by hand - dependency-name: 'mysql' update-types: ['version-update:semver-major', 'version-update:semver-minor'] @@ -34,8 +34,8 @@ updates: ignore: - dependency-name: 'ansibleforms/ansibleforms' update-types: ['version-update:semver-major'] - # MySQL stays on its LTS line (8.4) : its patches only. Dependabot cannot tell an LTS - # release from an innovation one, so moving to the next LTS is done by hand + # MySQL stays on its LTS line (8.4 on v6) : its patches only. Dependabot cannot tell an + # LTS release from an innovation one, so moving to the next LTS is done by hand - dependency-name: 'mysql' update-types: ['version-update:semver-major', 'version-update:semver-minor'] diff --git a/README.md b/README.md index 5e9acf0..53b80a3 100644 --- a/README.md +++ b/README.md @@ -61,6 +61,23 @@ docker compose exec mysqldb mysql -uroot -p -e "CREATE USER 'ansibleforms'@'%' I GRANT ALL PRIVILEGES ON AnsibleForms.* TO 'ansibleforms'@'%';" ``` +### MySQL 9.7 LTS + +`main` runs MySQL 9.7, the LTS that follows 8.4; the `v6` branch stays on 8.4. A setup on 8.4 upgrades in place on its +first start with 9.7, as MySQL supports moving to the next LTS, once these steps are done while it still runs 8.4. + +1. Back up the database (`data/mysql/db`), as before any upgrade. +2. List the users still signing in with `mysql_native_password`, which MySQL 9 no longer has, and move each of them to + `caching_sha2_password` with its own password: + + ```bash + docker compose exec mysqldb mysql -uroot -p -e "SELECT user, host FROM mysql.user WHERE plugin='mysql_native_password';" + docker compose exec mysqldb mysql -uroot -p -e "ALTER USER ''@'' IDENTIFIED WITH caching_sha2_password BY '';" + ``` + +3. Remove the line `mysql_native_password=ON` from `data/mysql/my.cnf`: MySQL 9 refuses to start with it. +4. Pull this version of the setup and start it again: `docker compose pull && docker compose up -d`. + ## Running playbooks AnsibleForms 7 runs no playbook in the app: the `rte` container runs them, from diff --git a/data/mysql/my.cnf b/data/mysql/my.cnf index b8bdb91..6423dab 100644 --- a/data/mysql/my.cnf +++ b/data/mysql/my.cnf @@ -1,2 +1 @@ [mysqld] -mysql_native_password=ON \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index 948d4ed..2568453 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,7 +1,7 @@ services: # MySql Server mysqldb: - image: mysql:8.4.13 + image: mysql:9.7.4 container_name: af_db restart: unless-stopped # load extra environment variables from file