问题
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?
回答1:
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.
回答2:
I know its over 1 year since this thread was created but I think I should share to you my experience with this problem and the solution I've made. Note, its for those who uses MySQL Workbench in Windows 7.
- Go to the directory C:\ProgramData\MySQL\MySQL Server 5.6\data (In some instances, if you cannot see the ProgramData folder, then unhide it first using the Folder and search options.)
- You can see in there the folder of that database (eg. temporarydata).
- Delete that folder.
Rerun your sql script.
drop database temporarydata;
Hope this helps.
回答3:
If you use wampserver and mariadb you can go directly here and delete the folder of your database :
C:\wamp64\bin\mariadb\mariadb10.2.8\data
来源:https://stackoverflow.com/questions/21403565/my-sql-error-code-1010-error-dropping-database-cant-rmdir-errno-13