Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 560
user984621 Avatar asked May 13 '13 16:05

user984621


2 Answers

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)

like image 148
Hackerman Avatar answered Sep 21 '22 02:09

Hackerman


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

/Applications/XAMPP/xamppfiles/var/mysql 
like image 44
kbokdia Avatar answered Sep 22 '22 02:09

kbokdia