MY SQL - Error Code: 1010. Error dropping database

2019-07-04 08:17发布

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?

3条回答
对你真心纯属浪费
2楼-- · 2019-07-04 08:31

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.

查看更多
做自己的国王
3楼-- · 2019-07-04 08:38

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.

查看更多
▲ chillily
4楼-- · 2019-07-04 08:45

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

查看更多
登录 后发表回答