I have a problem about running docker-compose.yml in my spring boot microservices.
When I tried to run the docker-compose.yml file through docker compose up, I got this issue shown below.
Caused by: java.sql.SQLSyntaxErrorException: Access denied for user 'springmicroserviceuser'@'%' to database 'userdb'
Here is the related part of docker-compose.yml
authservice:
image: 'microservicedailybuffer/authservice:0.0.1'
container_name: authservice
ports:
- '7777:7777'
environment:
- EUREKA_SERVER_ADDRESS=http://serviceregistry:8761/eureka
- CONFIG_SERVER_URL=configserver
- spring.datasource.url=jdbc:mysql://database:3306/userdb?createDatabaseIfNotExist=true&useSSL=false&allowPublicKeyRetrieval=true&serverTimezone=Turkey
- spring.datasource.username=springmicroserviceuser
- spring.datasource.password=111111
depends_on:
database:
condition: service_healthy
configserver:
condition: service_started
networks:
- backend
How can I fix it?
Here is the github repo : Link
Here is the git based system file : Link
Here is the docker-compose.yml file : Link