0

I try connecting spring boot application in docker with MySQL base on localhost

It's my application.properties, but the application cannot find the base

server.port = 8080


spring.jpa.hibernate.ddl-auto=update
spring.datasource.url=jdbc:mysql://${MYSQL_HOST:localhost}:3306/TestDB?useUnicode=true&serverTimezone=UTC&useSSL=true&verifyServerCertificate=false
spring.datasource.username=test
spring.datasource.password=test

I think the IP for MySQL in the container is different from the IP on the localhost

How I can connect to MySQL on localhost?

evgzabozhan
  • 140
  • 1
  • 11

0 Answers0