Categories
Mastering Development

Docker Mysql 8, Docker spring boot – Failed to configure a DataSource: ‘url’ attribute is not specified

I have spent 2 days, googling, trying all possible permutations combination, but didn’t work out so finally posting here. ->application.properties ## DATASOURCE #local connection #spring.datasource.url=jdbc:mysql://localhost:3306/Apple?useSSL=false&allowPublicKeyRetrieval=true&createDatabaseIfNotExist=true&autoReconnect=true # docker network connection spring.datasource.url=jdbc:mysql://mysqldb_container:3306/Apple?useSSL=false&allowPublicKeyRetrieval=true&createDatabaseIfNotExist=true&autoReconnect=true spring.datasource.username=root spring.datasource.password=root spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver ->build.gradle plugins { id ‘org.springframework.boot’ version ‘2.2.4.RELEASE’; id ‘io.spring.dependency-management’ version ‘1.0.9.RELEASE’ id ‘java’ }; group ‘org.example’; version ‘1.0-SNAPSHOT’; sourceCompatibility = 1.8; repositories […]