Skip to content

docs: make legacy MySQL 5.5 example restart-safe, fixes #737 - #738

Open
CyberSymbol wants to merge 1 commit into
ddev:mainfrom
CyberSymbol:20260904_CyberSymbol_legacy_mysql55_restart_safe
Open

docs: make legacy MySQL 5.5 example restart-safe, fixes #737#738
CyberSymbol wants to merge 1 commit into
ddev:mainfrom
CyberSymbol:20260904_CyberSymbol_legacy_mysql55_restart_safe

Conversation

@CyberSymbol

@CyberSymbol CyberSymbol commented Sep 4, 2026

Copy link
Copy Markdown

The Issue

The legacy MySQL 5.5 guide pins ddev/ddev-dbserver-mysql-5.5:v1.24.6. With a custom .ddev/mysql/*.cnf file, a later start of the same DB container can fail because the old entrypoint tries to overwrite a config file after removing its write permission.

How This PR Solves The Issue

The example now restores owner write permission on /etc/mysql/conf.d/* before the legacy entrypoint copies custom .cnf files. The added command is tolerant of an empty config directory, so the first start and later restarts both work. The article also notes that the underlying issue was fixed in DDEV v1.24.7.

Manual Testing Instructions

https://pr-738.ddev-com-fork-previews.pages.dev/blog/legacy-projects-with-unsupported-php-and-mysql-using-ddev/

Reproduced with DDEV v1.25.4, ddev/ddev-dbserver-mysql-5.5:v1.24.6, MySQL 5.5.62, and a custom .ddev/mysql/legacy.cnf. Before the change, restarting the existing DB container failed with cp: cannot create regular file '/etc/mysql/conf.d/legacy.cnf': Permission denied. After the change, a direct DB-container restart completed successfully and Docker reported running healthy.

Automated Testing Overview

No automated tests were added because this is a documentation-only change to a legacy example.

Release/Deployment Notes

No deployment changes are required.

Prepared and tested with assistance from ChatGPT.

@garvinhicking garvinhicking left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! :-)

exec ~/docker-entrypoint.sh
```

Three things are noteworthy:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs to now say "four" ;)

- Setting `linux/amd64` as the platform will require Rosetta to be available on the macOS ARM64 platform
- The `BASE_IMAGE` is set to a DDEV `db` container of legacy Docker images that are still provided.
- Changing the `entrypoint` is a workaround to prevent DDEV complaining about a mismatching MySQL version after restarting the project. The small script "tricks" the DDEV inspection into believing, the version matches the one configured in `.ddev/config.yaml`.
- The `mysql-5.5:v1.24.6` image removes write permission from copied custom `.cnf` files, which can cause `Permission denied` when restarting an existing DB container; the added `chmod` makes this example restart-safe. This underlying issue was fixed in DDEV v1.24.7.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- The `mysql-5.5:v1.24.6` image removes write permission from copied custom `.cnf` files, which can cause `Permission denied` when restarting an existing DB container; the added `chmod` makes this example restart-safe. This underlying issue was fixed in DDEV v1.24.7.
- The `mysql-5.5:v1.24.6` image removes write permission from copied custom `.cnf` files, which can cause `Permission denied` when restarting an existing DB container; the added `chmod` makes this example restart-safe. This underlying issue was fixed in DDEV v1.24.7. Depending on the date you are reading this you may want to consider raising the pinned version of the BASE_IMAGE, but may need to adapt line numbers or replacements in the sed replacements then.

Maybe something like this?

@rfay

rfay commented Sep 4, 2026

Copy link
Copy Markdown
Member

Please remember to add modifiedDate and modifiedComment in the frontmatter, thanks!

@github-actions

github-actions Bot commented Sep 4, 2026

Copy link
Copy Markdown

🌐 Fork Preview for PR #738

https://pr-738.ddev-com-fork-previews.pages.dev

This preview updates automatically when you push changes to your fork.

- Setting `linux/amd64` as the platform will require Rosetta to be available on the macOS ARM64 platform
- The `BASE_IMAGE` is set to a DDEV `db` container of legacy Docker images that are still provided.
- Changing the `entrypoint` is a workaround to prevent DDEV complaining about a mismatching MySQL version after restarting the project. The small script "tricks" the DDEV inspection into believing, the version matches the one configured in `.ddev/config.yaml`.
- The `mysql-5.5:v1.24.6` image removes write permission from copied custom `.cnf` files, which can cause `Permission denied` when restarting an existing DB container; the added `chmod` makes this example restart-safe. This underlying issue was fixed in DDEV v1.24.7.

@stasadev stasadev Sep 5, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This underlying issue was fixed in DDEV v1.24.7

It's easier to change the image:

-BASE_IMAGE: ddev/ddev-dbserver-mysql-5.5:v1.24.6
+BASE_IMAGE: ddev/ddev-dbserver-mysql-5.5:v1.25.4

And update the entrypoint.

@stasadev stasadev left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Legacy MySQL 5.5 guide can fail on repeated DB container starts with custom .cnf

4 participants