Issue
Mysql drop table command returns:
ERROR 1010 (HY000): Error dropping database (can't rmdir './mydatabase', errno: 39)
Likely Cause
There is a file in the database folder which isn't being managed by Mysql. This file could be hidden detritus or, more likely, an orphaned .ibd file.
# cd /var/log/mysql/mydatabase
# ls -la
total 72
drwx------ 2 mysql mysql 4096 Jun 23 19:57 ./
drwx------ 7 mysql mysql 4096 Jun 23 21:08 ../
-rw-rw---- 1 mysql mysql 65536 Jun 23 19:56 actions.ibd
Something Like a Solution
I just delete the problem file and run the database drop command again.
# rm -f actions.iddmysql> drop database mydatabase;
Query OK, 0 rows affected (0.00 sec)
References
本文介绍了一种常见的MySQL错误——当尝试删除包含未被MySQL管理文件的数据库时出现的错误1010,并提供了解决方案。通过删除问题文件并重新运行删除数据库命令可以解决此问题。
953

被折叠的 条评论
为什么被折叠?



