在 mysql 服务器的 Windows 上删除数据库时出错(不能 rmdir '.\abm',errno: 41)
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/29325007/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Error dropping database (can't rmdir '.\abm', errno: 41) on windows in mysql server
提问by aidonsnous
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\
试图寻找解决方案,我在此链接中找到了一些问题的答案在 MySQL 中删除数据库时出错(不能 rmdir '.\oro', errno: 41)但是我没有看到他们正在谈论的文件夹. 我进入了 C:\服务器 5.5\
回答by Michael - sqlbot
Windows Error 41 is "directory not empty." https://msdn.microsoft.com/en-us/library/t3ayayh1.aspx
Windows 错误 41 是“目录非空”。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.
谨慎行事。您不希望 MySQL 的内部结构与磁盘上的内容不一致。
Run the query SELECT @@DATADIR;
to find the directory that should contain a folder for each of your databases, including one called abm
.
运行查询SELECT @@DATADIR;
以查找应包含每个数据库的文件夹的目录,包括名为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.
与另一个问题中提供的建议相反,abm
一旦找到该文件夹,请不要删除它。相反,将文件夹留在那里,并将其中的文件移动到 MySQL 无法看到的 datadir 之外的某个位置。
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.
最后,通过查看日志中的错误,重新启动 MySQL 以绝对确保其内部结构与磁盘文件一致。如果服务器重新启动且没有错误,并且不再列出数据库,则删除上面复制的杂散文件应该是安全的。
回答by Vivek Keviv
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.
如果您是 Windows 用户。转到您的 XAMPP 目录 -> Mysql 目录 -> 数据 -> 然后您将看到此文件夹中的数据库列表。只需将数据库剪切并粘贴到桌面中要删除的某个位置即可。如果您使用的是 phpmyadmin,请刷新页面。如果您没有发现任何错误。你已准备好出发。
回答by Ravi
I was getting same error, and did two things
我遇到了同样的错误,做了两件事
- I just provided full access rights to current user.
- Open Database folder and than execute your sql (drop database mydatabase).
- 我只是为当前用户提供了完全访问权限。
- 打开数据库文件夹,然后执行您的 sql(删除数据库 mydatabase)。
If above solution not works for you, than you have to delete database folder manually.
如果上述解决方案对您不起作用,则必须手动删除数据库文件夹。