user984621 user984621 - 7 months ago 94
SQL Question

Drop database return "Error dropping database errno: 66" in MySQL

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?

Answer
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 DB folder: cd /usr/local/mysql/data/

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