当前位置:网站首页>docker: Error response from daemon: Conflict. The container name “/mysql“ is already in use by conta

docker: Error response from daemon: Conflict. The container name “/mysql“ is already in use by conta

2022-06-22 17:55:00 A bowl of humble powder

One 、 Problem description

 docker Install well MySQL after , An error occurs when an instance is created and started

docker: Error response from daemon: Conflict. The container name "/mysql" is already in use by container "5e1f4861f523bdff7cfcfb538d405ac506558b771f880ea4276a3104dfd49b5b". You have to remove (or rename) that container to be able to reuse that name.

Two 、 solve

(1) Remove the original container ID( It's the long string of numbers )

docker rm + container ID 

 (2) Create new container again

docker run -p 3306:3306 --name mysql \
-v /mydata/mysql/log:/var/log/mysql \
-v /mydata/mysql/data:/var/lib/mysql \
-v /mydata/mysql/conf:/etc/mysql \
-e MYSQL_ROOT_PASSWORD=root \
-d mysql:5.7

(3) Test for success

 

 

原网站

版权声明
本文为[A bowl of humble powder]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/173/202206221617067239.html