#Cannot connect to database with docker compose

4 messages · Page 1 of 1 (latest)

karmic helm
#

Hello I have microservice spring boot application which uses mysql db for storing user credentials and some other stuff. All services are up after i start docker compose but I cannot access database and I keep getting the same error:
The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
org.springframework.dao.DataAccessResourceFailureException: Unable to acquire JDBC Connection

Also I added my docker compose file.
I use yaml config for my services and I store credentials in .env but when I tried to hard code them error was still there.

IMPORTANT NOTE: Everything works fine without using docker compose and running it like normal java programs

quiet treeBOT
#

This post has been reserved for your question.

Hey @karmic helm! Please use /close or the Close Post button above when your problem is solved. Please remember to follow the help guidelines. This post will be automatically marked as dormant after 720 minutes of inactivity.

TIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here.

dim patrol
#

Maybe is something in your connection string . could you share it?