MY SQL - Error Code: 1010. Error dropping database (can't rmdir; errno: 13)

user3244139 picture user3244139 · Jan 28, 2014 · Viewed 20.7k times · Source

When trying to drop a database in MySQL

'DROP DATABASE IF EXISTS temporarydata'

I am getting the following error

Error Code: 1010. Error dropping database (can't rmdir '.\temporarydata', errno: 13)

I have researched into this and I think it may be a permission issue, however all the fixes I have found have been for linux computers. Has anyone got any idea how to sort this out in windows 7?

Answer

Abdul Manaf picture Abdul Manaf · Jan 28, 2014

Errno 13

MySQL has no write permission on the parent directory in which the temporarydata folder resides.Check it out

A database is represented by a directory under the data directory, and the directory is intended for storage of table data.

The DROP DATABASE statement will remove all table files and then remove the directory that represented the database. It will not, however, remove non-table files, whereby making it not possible to remove the directory.

MySQL displays an error message when it cannot remove the directory, you can really drop the database manually by removing any remaining files in the database directory and then the directory itself.