Error

Error connecting to MySQL: (2003, "Can't connect to MySQL server on 'db_server' ([Errno 111] Connection refused)")

Solution

I tried various methods in docker-compose.yml, but the conclusion was that

before the DB container was running, another container was trying to access it and an error occurred, causing it to crash.