Drop database return “Error dropping database errn

2019-01-31 11:53发布

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?

3条回答
爷的心禁止访问
2楼-- · 2019-01-31 12:03

FYI for mac users with normal mysql server:

/usr/local/mysql/bin/mysql -u root -pPASSWORD  -e "select @@datadir"
查看更多
Deceive 欺骗
3楼-- · 2019-01-31 12:06

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

/Applications/XAMPP/xamppfiles/var/mysql
查看更多
劳资没心,怎么记你
4楼-- · 2019-01-31 12:19
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)

查看更多
登录 后发表回答