Docker / WSL / Symfony / MySQL – SQLSTATE[HY000] [2002] Connection refused

I’m using WSL 2 and trying to connect to my MySQL database though my docker app container (Symfony 4.4). The other posts about this subject did not helped me to find a solution, that is why I asking you now. Don’t hesitate to ask me to add other files which can help us to get more informations about this problem.

How can nodemon be made to work with WSL 2?

Ever since updating from WSL 1 to WSL 2 with the Windows 10 April 2020 update (and thereafter updating Ubuntu 18 to Ubuntu 20), I have not been able to get nodemon to hot reload when there are file changes in the project’s directory. When I make any changes to .js files, there’s no restarting of the server or output at the terminal: