Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save ProblemaResolt/1c29ce86e38efa3e3584c37a8c29a72a to your computer and use it in GitHub Desktop.
Save ProblemaResolt/1c29ce86e38efa3e3584c37a8c29a72a to your computer and use it in GitHub Desktop.
Docker関連

#Dockerを使っていて以下のようなエラーが出た場合。

ERROR: for mysql  Cannot start service mysql: driver failed programming external connectivity on endpoint test-mysql (b2c5bfe3339ba18ad0892ba8fc5a1f427a89b3915035bc12b0c4c1207e016f75): Error starting userland proxy: Bind for 0.0.0.0:3306 failed: port is already allocated
ERROR: Encountered errors while bringing up the project.

エラー内容のところに Bind for 0.0.0.0:3306 failed: port is already allocated が入っているため3306ポートが使用されているのがわかる。 まずは使用されている port 3306 を探す。

Linux & Mac の場合

sudo lsof -i:3306

terminal.log

mysqld  9447 _mysql   13u  IPv6 0x6973239584594d63      0t0  TCP *:mysql (LISTEN)

プロセスの番号がわかったら削除する。

sudo kill {任意のPID}

Windowsの場合

netstat -nao|find 3306[^1]

terminal.log

mysqld  {任意のPID} _mysql   13u  IPv6 0x6973239584594d63      0t0  TCP *:mysql (LISTEN)

プロセスの番号がわかったら削除する。

taskkill /pid {任意のPID} /F
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment