22 June,2020 by Rambler
Question : I'm trying to drop a database in MariaDB with the following command : DROP DATABASE mydatabase, but getting an error message :
ERROR 1010 (HY000): Error dropping database (can't rmdir './mydatabase', errno: 39 "Directory not empty")
What is stopping the database from being dropped?
Answer: MariaDB represents a database in the data directory. When you're executing the DROP DATABASE command - you're making a request to delete the table files - followed by removal of the directory.
The DROP DATABASE command - does not drop non table file - therefore it cannot progress to the remove directory step.
That's the error message you see i.e unable to remove directory ERROR 1010 (HY000): Error dropping database (can't rmdir './mydatabase', errno: 39 "Directory not empty")
To fix this issue : Remove the non-table files and then attempt the DROP DATABASE command
Read more on MariaDB backup & restore
How to move a MariaDB table to another database;
How to fix Table doesn't exist in engine error for MariaDB Error 1932
This is only a preview. Your comment has not yet been posted.
As a final step before posting your comment, enter the letters and numbers you see in the image below. This prevents automated programs from posting comments.
Having trouble reading this image? View an alternate.
Posted by: |