Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error dropping database (can't rmdir '.\abm', errno: 41) on windows in mysql server

Tags:

mysql

I have a database that I would like to drop from the server but when I wanna drop it I am getting the above error.

Trying to look for the solution I found some answer the problem at this link Error in dropping a database in MySQL (can't rmdir '.\oro', errno: 41) but what I don't see the folder they are talking about. I went in the C:\Program Files\MySQL\MySQL Server 5.5\data folder but I coudn't see a folder with the name of my database not even when I did searching in the folder C:\Program Files\MySQL\MySQL Server 5.5\

like image 284
aidonsnous Avatar asked Mar 29 '15 02:03

aidonsnous


2 Answers

Windows Error 41 is "directory not empty." https://msdn.microsoft.com/en-us/library/t3ayayh1.aspx

Proceed cautiously. You don't want MySQL's internal structures to become inconsistent with what's on the disk.

Run the query SELECT @@DATADIR; to find the directory that should contain a folder for each of your databases, including one called abm.

Contrary to the advice offered in the other question, don't delete the abm folder once you find it. Instead, leave the folder there, and move the files inside it somewhere outside the datadir where MySQL can't see them.

Then try again to drop the database the normal way.

Finally, restart MySQL to be absolutely sure that its internal structures are consistent with the disk files, by reviewing the log for errors. If the server restarts with no errors, and the database is no longer listed, it should be safe to delete the stray files you copied out of harm's way, above.

like image 129
Michael - sqlbot Avatar answered Sep 20 '22 07:09

Michael - sqlbot


If you are windows user. Go to your XAMPP directory -> Mysql directory -> data -> then you will be seeing your list of databases inside this folders. Just cut and paste the database outside somewhere in desktop which you want to remove. If you are using phpmyadmin refresh the page. If you are not finding any errors. you are good to go.

like image 25
Vivek Keviv Avatar answered Sep 20 '22 07:09

Vivek Keviv