I am trying to create a container with docker-compose so I ran docker-compose up on the following compose file:
services:
mysql:
image: mysql:5.7
ports:
- "3306:3306"
environment:
MYSQL_ROOT_PASSWORD: root
MYSQL_USER: admin
MYSQL_PASSWORD: joesam007#
MYSQL_DATABASE: Woodcore-test
After pulling and building the image, while trying to create the db, the error response shows thus:
Creating microservice-task_mysql_1 ...
Creating microservice-task_mysql_1 ... error
ERROR: for microservice-task_mysql_1 Cannot start service mysql: driver failed programming external connectivity on endpoint microservice-task_mysql_1 (3f2a9ad024c6e586a9c7f089a388cecf7decbf7870106b5b34e5a21e88b415a3): Error starting userland proxy: listen tcp4 0.0.0.0:3306: bind: address already in use
I'd like to know how to handle this issue and create the db successfully. Please help, thanks.
listen tcp4 0.0.0.0:3306: bind: address already in use: make sure you don't have another service or app running on this port.