Unable to Connect Mysql container from a spring-boot application

I recommend that you don’t create the containers on the command line, but with docker-compose (see docs for compose file, docs for compose cli). Then you can simply address the MySQL container with its service name and don’t have to worry about managing networks (docker compose will do this for you).