Drop database return “Error dropping database errno: 66” in MySQL

 ̄綄美尐妖づ 提交于 2019-11-28 18:27:59

问题


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/...

How do I fix this issue?


回答1:


mysql> drop database DB_NAME; 
ERROR 1010 (HY000): Error dropping database 
(can't rmdir './DB_NAME', errno: 66)
  1. Find the database directory: mysql -e "select @@datadir" -> /usr/local/mysql/data/

  2. Go to the DataBase folder: cd /usr/local/mysql/data/

  3. Delete DB folder of the DB with the issue (in this case: sudo rm -rf DB_NAME)




回答2:


If you are using XAMPP in OSX the data directory would be at

/Applications/XAMPP/xamppfiles/var/mysql



回答3:


FYI for mac users with normal mysql server:

/usr/local/mysql/bin/mysql -u root -pPASSWORD  -e "select @@datadir"


来源:https://stackoverflow.com/questions/16527054/drop-database-return-error-dropping-database-errno-66-in-mysql

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!