服务器在前两天被重启了,docker中的mysql没有开机自启,我按照之前的启动命令:docker run -p 3007:3006 --name mysql8.0 -d mysql:8.0 -e MYSQL_ROOT_PASSWORD=123456
出现报错:docker: Error response from daemon: Conflict. The container name "/mysql8.0" is already in use by container "aa44c0b1e36384883e3030b9fa35621e96ff0b5fc09ac8f1ae11ea9922a8285b". You have to remove (or rename) that container to be able to reuse that name.See 'docker run --help'
我搞了半天,以为是我命令输入错误,在网上搜了一下,发现一个命令就解决
docker restart 镜像名