Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Database Connection Error #82

Open
1988gadocansey opened this issue Aug 19, 2023 · 1 comment
Open

Database Connection Error #82

1988gadocansey opened this issue Aug 19, 2023 · 1 comment

Comments

@1988gadocansey
Copy link

I'm getting database access denied for root using password yes when running the make up. Below is my compose.yaml

version: "3.7"
services:
web:
image: go-clean-arch
container_name: article_management_api
ports:
- 9090:9090
depends_on:
mysql:
condition: service_healthy
volumes:
- ./config.json:/app/config.json

mysql:
image: mysql:5.7
container_name: go_clean_arch_mysql
command: mysqld --user=root
volumes:
- ./article.sql:/docker-entrypoint-initdb.d/init.sql
ports:
- 3305:3305
environment:
- MYSQL_DATABASE=article
- MYSQL_USER=root
- MYSQL_PASSWORD=
- MYSQL_ROOT_PASSWORD=
healthcheck:
test: ["CMD", "mysqladmin", "ping", "-h", "localhost"]
timeout: 5s
retries: 10

@ljluestc
Copy link

ljluestc commented Dec 2, 2023

version: "3.7"
services:
web:
image: go-clean-arch
container_name: article_management_api
ports:
- 9090:9090
depends_on:
mysql:
condition: service_healthy
volumes:
- ./config.json:/app/config.json

mysql:
image: mysql:5.7
container_name: go_clean_arch_mysql
command: mysqld --user=root
volumes:
- ./article.sql:/docker-entrypoint-initdb.d/init.sql
ports:
- 3305:3305
environment:
- MYSQL_DATABASE=article
- MYSQL_USER=root
- MYSQL_ROOT_PASSWORD=myrootpassword # Set your root password here
healthcheck:
test: ["CMD", "mysqladmin", "ping", "-h", "localhost"]
timeout: 5s
retries: 10

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants