无法通过 docker-compose mysql 容器通过 node js Sequelize 使用命令行连接我能够访问 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