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
Preface In the process of using MySQL database, i...
Use the Vue-Cropper component to upload avatars. ...
Translucent border Result: Implementation code: &...
The following situations were discovered during d...
How to change the MySQL database directory locati...
Table of contents Preface analyze Initial Renderi...
Repetition: Repeat certain page design styles thr...
Hello everyone, today when I was looking at the H...
The following is an introduction to using SQL que...
1. Delete node Execute kubectl delete node node01...
view: Views in MySQL have many similarities with ...
About JS, CSS CSS: Stylesheet at the top Avoid CS...
The nginx configuration is as follows: Such as ht...
Below, we introduce three ways to draw heart shap...
When the server needs to be started during develo...