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?

Answers:

Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.

Method 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)

Method 2

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

/Applications/XAMPP/xamppfiles/var/mysql

Method 3

FYI for mac users with normal mysql server:

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


All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x