Ddev项目提示‘db service stopped’无法启动,报健康检查超时
Hey, I’ve run into this exact problem before—super frustrating when your project was working fine yesterday but won’t start today. Let’s walk through some reliable fixes step by step:
First, do a full Ddev + Docker reset
Sometimes stale containers or cached state are the culprit. Run these commands in order:# Stop all running Ddev projects and shut down Ddev's backend ddev poweroff # Delete all Ddev projects (skip snapshots since the DB is already broken) ddev delete --omit-snapshot --all # Restart your Docker service entirely # For Linux: sudo systemctl restart docker # For Mac/Windows: Open Docker Desktop and click "Restart" from the menuCheck your project's DB configuration
Pop open your.ddev/config.yamlfile and verify thedb_imagesetting. If you’ve customized it recently, try reverting to the default (e.g.,ddev/ddev-dbserver-mariadb-10.4or the version matching your project). Custom images sometimes have compatibility issues that cause startup failures.Verify Docker has enough resources
DB services need sufficient memory to start up. If you’re on Mac or Windows, open Docker Desktop’s settings, go to "Resources", and make sure you’ve allocated at least 2GB of memory (4GB is better for larger projects). On Linux, ensure your system has enough free RAM for the DB container to run.Dig into the DB container logs
The health check timeout usually means the DB failed to start for a specific reason—logs will tell you what that is. Run this command for your project:ddev logs -s dbCommon issues here include corrupted database files, permission errors, or misconfigured DB settings. If you see corruption errors, you can wipe the DB volume and start fresh:
ddev stop -a ddev delete --omit-snapshot your-project-name ddev startNote: This will erase your local DB data, so only do this if you have a backup or can rebuild the DB from a dump.
Fix Docker network conflicts
Rarely, Ddev’s default network can get into a broken state. Try rebuilding it:ddev poweroff docker network rm ddev_default ddev start
Most of the time, the full reset or log inspection will get your DB service back up and running.
内容的提问来源于stack exchange,提问作者rfay

