Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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']
Expand All @@ -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']

Expand Down
17 changes: 17 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 '<user>'@'<host>' IDENTIFIED WITH caching_sha2_password BY '<its password>';"
```

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
Expand Down
1 change: 0 additions & 1 deletion data/mysql/my.cnf
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
[mysqld]
mysql_native_password=ON
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Loading