Fails to initialize MySQL database on Windows 10

前端 未结 4 927
花落未央
花落未央 2020-12-16 15:10

Using Laradock

System Info:

  • Docker version: 17.10.0-ce, build f4ffd25
  • OS: Windows 10 Home

When I run docker-compose up -d my

4条回答
  •  既然无缘
    2020-12-16 15:40

    I had the same problem with my Windows 10 Enterprise, I couldn't find perfect solution around it because it seems to be my Windows version issue - I have ran the same image on other windows (8 & 10 professional) successfully. My temporary work around was to remove the /var/lib/mysql mount entirely from the docker-compose file allowing the database data files to be created and modified in the container itself.

    I use kitematics which will restart and reattach my created container anytime I want to work on the container, like that I don't loose my data when the container exit. If you don't use kitematics this what it does. After running docker-compose the image will be created and a container will be created to run it as well, I avoid using run on the created image because this will create new container I stick to running the following sequentially

    docker ps -a                 # this command will get container_id of all container, those that are running and those that are not
    docker start   # start container from background
    docker attach  # attach container to standard input
    

    With these docker commands my data were preserved in the container even after exiting and restarting

    BACK UP

    Now whenever I want to move the data, I will commit my container into an image and save the image to local storage

    docker commit  :<1_31_2017> # I use date to tag it
    docker save -o  
    

    RESTORE

    Whenever I need to restore the mysql container either on my computer or for a new programming intern

    cd 
    docker load -o  
    

    This solution is for your update

     File ./ib_logfile101: 'aio write' returned OS error 122. Cannot continue operation
    

    I hope this helps somebody

提交回复
热议问题