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