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

夙愿已清 提交于 2019-12-12 13:51:58

问题


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.

  1. 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.)
  2. You can see in there the folder of that database (eg. temporarydata).
  3. Delete that folder.
  4. 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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!