The project test environment database data is lost, so I would like to record it. It was installed using Docker at the time, thinking it would be used temporarily for a period of time and not be persistent. Suddenly the day before yesterday, the docker log was full, and my colleague wanted to clean up the log and used the following command: docker system prune As a result, the MySQL container was normally in a stopped state at the time, but it was killed all of a sudden. The data we backed up was from March, which was terrible. Then various studies began to resume. Then I went to the official documentation to study what this command does.
Now I feel relieved. Fortunately, the data volume has not been deleted. We can use the data volume to recover the data. Next, I will record my recovery plan. 1. Find the data volume location The data volume directory is under This 2. Recovery Use
Then create the container docker run -d -p 3309:3306 -v mysqldata:/var/lib/mysql -e MYSQL_ROOT_PASSWORD=123456 --name huifu mysql:5.7 Before recovering data, you need to delete the associated content in the newly created data volume, and then copy the previous data volume content to the current data volume for data recovery. cd /var/lib/docker/volumes/mysqldata/_data/ rm -f * rm -f -R * Copy content to data volume cd /var/lib/docker/volumes/1db16a9dfdf3442b117ebc2ec11df5df4db717cfd567c77fa0a49905a9652fa0/_data/ cp -R * /var/lib/docker/volumes/mysqldata/_data/ At this point, the database data recovery is complete. Enter the restored container to view Referenceshttps://docs.docker.com/engine/reference/commandline/system_prune/ https://www.cnblogs.com/cheyunhua/p/13433400.html This is the end of this article on how to recover docker container data. For more information about docker container data recovery, please search 123WORDPRESS.COM’s previous articles or continue to browse the following related articles. I hope you will support 123WORDPRESS.COM in the future! You may also be interested in:
|
<<: A method of making carousel images with CSS3
>>: Design Theory: Textual Expression and Usability
1. Create a SpringBooot project and package it in...
Authorization is to grant certain permissions to ...
I just finished installing MySQL 5.7.19 in the ea...
recommend: Navicat for MySQL 15 Registration and ...
Preface In order to follow the conventional WEB l...
I saw that Taobao’s webpage uses import, while man...
In HTML, the Chinese phrase “學好好學” can be express...
On mobile devices, flex layout is very useful. It...
GUN Screen: Official website: http://www.gnu.org/...
In actual projects, the database needs to be back...
background Some time ago, our project team was he...
I am using centos 7 64bit system here. I have tri...
It is mainly the configuration jump of the if jud...
In requireJS, there is a property called baseURL....
The following script is used for scheduled backup...