Some problems encountered by ubuntu docker

Boot into the docker mysql container console mysql not found

Use the docker exec command to enter the container to perform operations

#root 
#Docker exec 命令
docker run -itd --name mysql2020 -p 3306:3306 -e MYSQL_ROOT_PASSWORD=root mysql
#进入容器
docker exec -it mysql2020 bash

root@(container的id):/#
mysql -u root -p
#退出容器
exit

Less packages in docker container (for example, vim can be used in ubuntu system)

#先进入容器 参考上条docker exec命令
#进入容器后
sudo apt-get update
sudo apt-get install vim

docker delete pause start restart container

#root  容器标识(容器名或者containerid)例如mysql2020或者2c91a61bd1b3(docker ps命令)
docker rm 容器标识
docker stop 容器标识
docker start 容器标识
docker restart 容器标识

There are also the following operation container commands 

#docker mysql Containers often stop unexpectedly

#Solving

 

 

 

Long-term record last edit time ---------------July 6, 2020 10:03:04

 

Sincerely

Guess you like

Origin blog.csdn.net/weixin_40195422/article/details/106713063