After mysql, delete its image & container and install it again. Why does the data still exist?? What should I do

Alibaba cloud Q & A 2022-02-13 07:58:29 阅读数:859

mysql delete image container install

I use docker-compose Installed a -server, Then delete it ( Images and containers ) after , Use... Again docker-compose mount , Find the attached mysql Still save the data of the previous operation ?

direct :

rm -f $(docker ps -a -q) rmi -f (docker images)

Then reinstall , however , still 500 error ... I looked at the code, no problem , There are no error logs .




Take the answer 1:

Hello! , The data still exists because mysql The data is mounted . Pay attention to see docker-compose In the document volume To configure . Or it is recommended that you use this command , If you don't want the data .

docker-compose down -v

copyright:author[Alibaba cloud Q & A],Please bring the original link to reprint, thank you. https://en.javamana.com/2022/02/202202130758277219.html