##環境
Docker version 20.10.7
docker-compose version 1.29.2
##状況
$ docker-compose up
した際に「すでにport3306は使われている」というエラーを吐いた
$ docker-compose up
Creating XXXXXX_db_1 ... error
Creating XXXXXX_redis_1 ...
Creating XXXXXX_redis_1 ... done
Creating XXXXXX_worker_1 ... done
ERROR: for db Cannot start service db: Ports are not available: listen tcp 0.0.0.0:3306: bind: address already in use
ERROR: Encountered errors while bringing up the project.
##解決方法
port3306が開いてるDBを確認してkill
$ sudo lsof -i -P | grep "LISTEN"
mysqld 122 _mysql 24u IPv6 0x4f20f24da9e855fb 0t0 TCP *:3306 (LISTEN)
$ sudo kill 122