在docker內重啟mysql服務的方法
1.首先,在命令行中使用以下命令重啟docker;
sudo systemctl start docker
2.Docker重啟后,列出Docker中創建的容器,查看mysql服務的id;
docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
bd14b4db22c3 centos/mysql-57-centos7 "container-entrypoin…" 22 hours ago Exited (255) 11 minut
3.最后,在命令行中使用以下命令即可重啟mysql服務;
docker restart bd14b4db22c3