Error dropping database (can’t rmdir ‘./database’, errno: 39)

Just a very quick post today! If you encounter this error when attempting to drop a MySQL database;

Error dropping database (can't rmdir './database', errno: 39)

Then you probably have some rogue files in the folder where the database files are located. If you cd into this directory you will be able to view these files. In my case I had a tar archive containing the files the database was restored from. Just delete any files in this directory and you’ll be able to complete the drop.


3 Comments

  1. en says:

    Thank you. I did not see any suspicious files but deleting the *.frm files worked for me.

  2. Chris says:

    Thanks! First hit in Google for my search terms and you were spot on. In my case I had result.csv in there…

  3. MikeC says:

    Worked for me as well, I had a copy of a table file as a backup. Thanks!!

Leave a Reply