在 MySQL 中删除数据库返回“错误删除数据库 errno: 66”
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/16527054/
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
Drop database return "Error dropping database errno: 66" in MySQL
提问by user984621
Consider:
考虑:
DROP DATABASE db_name;
ERROR 1010 (HY000): Error dropping database (can't rmdir './db_name', errno: 66)
The problem is that I don't know where the file/directory is located - this file is missing in /usr/local/mysql/bin/...
问题是我不知道文件/目录位于何处 - /usr/local/mysql/bin/ 中缺少此文件...
How do I fix this issue?
我该如何解决这个问题?
回答by Hackerman
mysql> drop database DB_NAME;
ERROR 1010 (HY000): Error dropping database
(can't rmdir './DB_NAME', errno: 66)
Find the database directory:
mysql -e "select @@datadir"
->/usr/local/mysql/data/
Go to the DataBase folder:
cd /usr/local/mysql/data/
Delete DB folder of the DB with the issue (in this case:
sudo rm -rf DB_NAME
)
找到数据库目录:
mysql -e "select @@datadir"
->/usr/local/mysql/data/
转到数据库文件夹:
cd /usr/local/mysql/data/
删除这个问题的DB的DB文件夹(在这种情况下:
sudo rm -rf DB_NAME
)
回答by kbokdia
If you are using XAMPP in OSX the data directory would be at
如果您在 OSX 中使用 XAMPP,则数据目录位于
/Applications/XAMPP/xamppfiles/var/mysql
回答by Bj?rson ?lmer
FYI for mac users with normal mysql server:
仅供具有普通 mysql 服务器的 mac 用户使用:
/usr/local/mysql/bin/mysql -u root -pPASSWORD -e "select @@datadir"