I was following this wonderful tutorial to get a docker container up and running but ran into some issues that I can’t seem to resolve.
Following the guide exactly, both of the containers start up, but when I go to the Drupal Installation it returns " Failed to connect to your database server. The server reports the following message: SQLSTATE[HY000]  Connection refused." If I use docker-compose to enter bash on the database container I can access mysql from the command line, but from the drupal container, it’s inaccessible. Same goes for my Linux Host. I thought this might be because I had a MariaDB server running on my host and they were fighting for the same port so I stopped the one on my host and ran docker-compose again to build both but nothing changed.
What should I do? Thanks ahead of time.
EDIT: I wanted to also point that I have tried logging in like so from my drupal container
mysql -h 127.0.0.1 -u root -P 3306 -p and I get a different error
ERROR 2003 (HY000): Can't connect to MySQL server on '127.0.0.1' (111 "Connection refused"). I thought I might end up chasing down firewall configs for a while before I decided to try the wodby/docker4drupal images ( https://github.com/wodby/docker4drupal ). Those worked out perfectly, so this definately isn’t a firewall issue, but rather a networking issue between the containers. Really interested to see what it could be.