I am trying to create mysql container in kubernetes at mount path /var/lib/mysql but when I do deployment I am getting below error.
2022-12-16T07:13:59.139528Z 0 [ERROR] [MY-010457] [Server] --initialize specified but the data directory has files in it. Aborting.
2022-12-16T07:13:59.139537Z 0 [ERROR] [MY-013236] [Server] The designated data directory /var/lib/mysql/ is unusable. You can remove all files that the server added to it.
How can I fix this error. I want to create MySql container and store the database in some folder so that on new deployement I am able to get that old data.
1条答案
按热度按时间olhwl3o21#
2022-12-16T07:13:59.139528Z 0 [ERROR] [MY-010457] [Server] --initialize specified but the data directory has files in it. Aborting.
Your directory is not empty. You have to remove all the contents of it or choose another one.
The error message "Newly created data directory /var/lib/mysql/ is unusable" comes up because of a size issue. Check/increase the underlying server size or the docker allocated size for the system.
You can also create a docker container from the command line to fill an empty data directory by MySQL initialization and after that use docker-compose. When the data directory is already initialized no errors appear.
Also check GitHub link and Stackpost .