简体   繁体   中英

MySQL with Persistent Volume Claim on Kubernetes

I created a volume and a persistent volume claim. Then I create a MySQL with a map to this volume claim. But the MySQL container does not start because: "2019-11-15T15:08:57.611908Z 0 [ERROR] --initialize specified but the data directory has files in it. Aborting." Nevertheless, this is a fresh volume just created into which I have not added anything. How come there is something in it. How to clean it? Thanks for any suggestions. C

Thanks. Actually, found workaround solution: used the yaml for pod creation that is given here https://kubernetes.io/docs/tasks/configure-pod-container/configure-persistent-volume-storage/ Then logged into the pod, went to the directory and indeed, there was a "lost+found" directory which I believe is automatically created by Kubernetes. Removed this directory and ensure it is empty. Then started my mysql again... and it worked.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM