'SequelizeConnectionRefusedError:在Promise.tap.then.catch.err

时间:2019-06-08 04:11:27

标签: docker docker-compose connect econnrefused

无法通过节点js通过docker-compose mysql容器进行连接,使用命令行我可以访问mysql。

 mysql-db:
    image: mysql:5
      # COPY  
    environment:
      - MYSQL_ROOT_PASSWORD:"root"
      - MYSQL_DATABASE:"dbname"
      - MYSQL_USER:"root1"
      - MYSQL_PASSWORD:"root1"
      - MYSQL_ROOT_HOST:"%"
    ports:
      - "3306:3306"
    expose:
      - "3306"
    volumes:
      - ./mysqld.cnf:/etc/mysql/mysql.conf.d/mysqld.cnf
    networks:
      - boilerplate-network
    command: --log-bin=/var/lib/mysql/mysql-bin.log --binlog-format=ROW --server-id=1
    # configs:
    #   - source: mysqld.cnf
    #     target: /etc/mysql/mysql.conf.d/mysqld.cnf

0 个答案:

没有答案