Unable to start mysql container using docker


Iam trying to run mysql container using docker. getting connection refused exception.
but Iam able to login in my local machine using same credentials.

Steps Followed :

Downloaded the project
clean install done
updated the pom.xml with DB properties as suggested in the below doc

it says there no communication link to your server, so, it is not a password/username issue…mysql server is not reachable from your tomcat.

How can I fix that?

by making sure communication between mysql and tomcat is possible. But, I don’t know how you setup this, so, I have no steps for you if you expect that.

Most likely it will be because you are using localhost in your container, which will not work on docker containers as localhost is inside the container.

You will need to do this.

host.docker.internal gets the ip of the host system, which in turn will resolve back to meaning the container will then see mysql whther it is running in a docker container, (Best way) or installed on the machine

We have bloomreach working against mysql locally using docker compose no problems