docker: Error response from daemon: driver failed programming external connectivity on endpoint mysql (3d8d89f260c9258467f589d4d7d0c27e33ab72d732d1115d1eb42d708606edc4):
这里为止是容器被占用了
# docker ps -a ConTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES a57959032cc9 mysql:5.7 "docker-entrypoint.s…" about a minute ago Created mysql # docker rm a57959032cc9 a57959032cc9
Error starting userland proxy: listen tcp4 0.0.0.0:3306: bind: address already in use.
这个下面的就是端口号被占用了
# netstat -tanlp Active Internet connections (servers and established) Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 948/sshd tcp 0 0 0.0.0.0:3306 0.0.0.0:* LISTEN 9217/mysqld tcp 0 0 172.18.7.111:39412 100.100.45.106:443 TIME_WAIT - tcp 0 0 172.18.7.111:22 58.100.92.78:9024 ESTABLISHED 6899/sshd: root@pts
自己看看是哪个被占用了然后用 kill + 端口号 进行删除



