在 MySQL 中删除数据库时出错(不能 rmdir '.\oro',errno: 41)
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/17947255/
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 in dropping a database in MySQL (can't rmdir '.\oro', errno: 41)
提问by Dani
I can't delete a database from mysql. The error is like
我无法从 mysql 中删除数据库。错误就像
ERROR 1010 (HY000): Error dropping database (can't rmdir '.\oro', errno: 41)
ERROR 1010 (HY000): Error dropping database (can't rmdir '.\oro', errno: 41)
I tried to drop the database 'oro' using phpmyadmin and it also showing the same error message and alerts
我尝试使用 phpmyadmin 删除数据库“oro”,它也显示相同的错误消息和警报
"DROP DATABASE" statements are disabled.
"DROP DATABASE" statements are disabled.
回答by Jamshid Hashimi
In my case, I solved the problem by navigating to the folder:
就我而言,我通过导航到文件夹解决了这个问题:
C:\wamp\bin\mysql\mysql5.6.12\data
and remove the database folder which I was trying to drop. That's it.
并删除我试图删除的数据库文件夹。就是这样。
回答by Himanil Gupta
The ERROR 1010 you got is occurred When you create a database, a file is created for you. This implies "create database foo" will create a directory foo in your data directory. All table definitions/data for foo are in the foo directory. All these tables are created in the server and their corresponding files are created by the server. If, for some reason, a file is created in or placed in this directory that is not generated by MySQL, the error 1010 will be issued by the server when you drop foo.
您得到的 ERROR 1010 发生在您创建数据库时,会为您创建一个文件。这意味着“创建数据库 foo”将在您的数据目录中创建一个目录 foo。foo 的所有表定义/数据都在 foo 目录中。所有这些表都是在服务器中创建的,它们对应的文件由服务器创建。如果由于某种原因在这个目录中创建或放置了一个不是由 MySQL 生成的文件,那么当你删除 foo 时,服务器将发出错误 1010。
and in case when you are trying to drop database using phpmyadmin refer this phpmyadmin enable drop database statement.
如果您尝试使用 phpmyadmin 删除数据库,请参阅此phpmyadmin enable drop database 语句。
Hope this may help you to understand the error.
希望这可以帮助您理解错误。
回答by Hrishikesh Kashyap
- Go to
C:\wampXY\bin\mysql\mysqlx.y.z\data
- 去
C:\wampXY\bin\mysql\mysqlx.yz\data
(XY.. refer versions)
(XY.. 参考版本)
Rename the file you want to delete to anything else.(optional only for special cases)
Now simply delete the renamed file.
将要删除的文件重命名为其他任何名称。(仅在特殊情况下可选)
现在只需删除重命名的文件。
回答by Alpesh Jikadra
Mysql generate two file for any table
Mysql为任意表生成两个文件
- .frm
- .ibd
- .frm
- .ibd
check in your directory for both file must exist, if any one is missing then remove the remaining one or if you wish you can remove all the file, but be careful this my delete all your data from tables.
检查您的目录中的两个文件必须存在,如果缺少任何一个,则删除剩余的一个,或者如果您希望可以删除所有文件,但要小心,我会从表中删除所有数据。
This works for me, I hope it also works for you too.
这对我有用,我希望它也对你有用。
回答by Stephen Gillespie
I realize I'm really late to the party, but when I had this issue (and ended up here) I navigated to the directory and actually found a file had inadvertently been created in the directory via INTO OUTFILE without a path, and I'd forgotten about it. MySQL seemed to have an issue because it had not created the file, and so could not delete the directory in question.
我意识到我参加聚会真的迟到了,但是当我遇到这个问题(并最终在这里)时,我导航到该目录,实际上发现通过 INTO OUTFILE 无意中在目录中创建了一个没有路径的文件,我d 忘记了。MySQL 似乎有问题,因为它没有创建文件,因此无法删除有问题的目录。
回答by Edeeson Opina
If you're using XAMPP just go to C:/xampp/mysql/data/YourDBFolder
如果您使用的是 XAMPP,请转到 C:/xampp/mysql/data/YourDBFolder
After deleting that folder everything should be okay.
删除该文件夹后一切都应该没问题。
回答by Mad Dog Tannen
try changing the value in config file of phpmyadmin,
尝试更改 phpmyadmin 配置文件中的值,
$cfg['AllowUserDropDatabase'] = TRUE;