LoginSignup
0
0

More than 1 year has passed since last update.

エラー:Cannot start service db: Ports are not available: listen tcp 0.0.0.0:3306: bind: address already in use

Posted at

環境

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
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0