Search code examples
mysqldatabasedockerintellij-ideaconnection

Intellij connection to mysql database in docker problem


Hello I have problem with connection. I wonder why it didn't work I would appreciate any help.

Database type is MYSQL which is located in docker container.

This is my inteli connection settings screenshot inteliJ connection settings with problem in screenshot

This is my application.properties file

spring.datasource.url=jdbc:mysql://192.168.99.100/registr
spring.datasource.username=root

spring.datasource.password=heslo

spring.datasource.schema=classpath*:db/structure.sql
spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.MySQL5InnoDBDialect

logging.level.org.hibernate.SQL=DEBUG
logging.level.org.hibernate.type=TRACE

This is my docker settings

docker container

registr database grants

Telnet and ping images:

ping command

Telnet


Solution

  • I find a solution. Time for story. Yesterday It was working on settings which I post in screenshots etc. Docker was showing this --> docker is configured to use the default machine with IP 192.168.99.100 At end of day I turned off PC and today started and Docker changed to this --> docker is configured to use the default machine with IP 192.168.99.101

    so I just changed IP and it's working

    I appologize for my bad.