Article ID: 129741, created on Oct 29, 2016, last review on Oct 29, 2016

  • Applies to:
  • Operations Automation

Symptoms

Drop database task fails with the error:

Task name       Drop database db123456_dbname on host 192.168.10.100
Last execution output   MySQL API error: Error dropping database (can't rmdir './db123456_dbname', errno: 39).

At the same time it looks like database is already empty - attempt to drop it manually fails as well with the same error:

mysql> DROP DATABASE db123456_dbname;
ERROR 1010 (HY000): Error dropping database (can't rmdir './db123456_dbname', errno: 39)

mysql> use db123456_dbname;
Database changed

mysql> show tables;
Empty set (0.00 sec)

Cause

Database files were manually copied to the server, and folder /var/lib/mysql/db123456_dbname actually contains a database:

# du -hsx /var/lib/mysql/db123456_dbname
20M     /var/lib/mysql/db123456_dbname

of which MySQL is not aware of.

Resolution

Backup database folder /var/lib/mysql/db123456_dbname, delete files from /var/lib/mysql/db123456_dbname and then restart the failed task.

Search Words

MySQL API error: Error dropping database (can't rmdir './db250297_dcs', errno: 39).

MySQL API error: Error dropping database

MySQL API error: Error dropping database (can't rmdir './db1013645_flocra', errno: 39).

Drop database

5356b422f65bdad1c3e9edca5d74a1ae caea8340e2d186a540518d08602aa065 e12cea1d47a3125d335d68e6d4e15e07

Email subscription for changes to this article
Save as PDF