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

Sequelize Error: connect ECONNREFUSED 127.0.0.1:3306 #18

Open
doornot opened this issue Jun 21, 2021 · 2 comments
Open

Sequelize Error: connect ECONNREFUSED 127.0.0.1:3306 #18

doornot opened this issue Jun 21, 2021 · 2 comments

Comments

@doornot
Copy link

doornot commented Jun 21, 2021

docker-compose up

db容器报错正常启运行

realworld容器报错: Sequelize Error: connect ECONNREFUSED 127.0.0.1:3306

@klren0312
Copy link

具体配置

@doornot
Copy link
Author

doornot commented Jun 22, 2021

具体配置

version: '3'
services: 
  realworld:
    image: sinchang/realworld:latest
    environment:
      - NODE_ENV=production
      - EGG_SERVER_ENV=prod
      - DB_USER=wang
      - DB_DATABASE=realworld
      - DB_PASSWORD=
    depends_on:
      - db
    networks:
      - docker_realworld
    ports:
      - 7001:7001

  db:
    image: mysql:5.7
    volumes:
      - db_data:/var/lib/mysql
    restart: always
    environment:
      - MYSQL_ROOT_PASSWORD=
      - MYSQL_DATABASE=realworld
      - MYSQL_USER=wang
      - MYSQL_PASSWORD=
    networks:
      - docker_realworld

volumes:
  db_data:

networks:
  docker_realworld:
    driver: bridge    

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