Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error in dropping a database in MySQL (can't rmdir '.\oro', errno: 41)

I can't delete a database from mysql. The error is like

ERROR 1010 (HY000): Error dropping database (can't rmdir '.\oro', errno: 41)

I tried to drop the database 'oro' using phpmyadmin and it also showing the same error message and alerts

"DROP DATABASE" statements are disabled.

like image 508
Dan Avatar asked Jul 30 '13 12:07

Dan


4 Answers

In my case, I solved the problem by navigating to the folder:

C:\wamp\bin\mysql\mysql5.6.12\data

and remove the database folder which I was trying to drop. That's it.

like image 82
Jamshid Hashimi Avatar answered Nov 03 '22 04:11

Jamshid Hashimi


The ERROR 1010 you got is occurred When you create a database, a file is created for you. This implies "create database foo" will create a directory foo in your data directory. All table definitions/data for foo are in the foo directory. All these tables are created in the server and their corresponding files are created by the server. If, for some reason, a file is created in or placed in this directory that is not generated by MySQL, the error 1010 will be issued by the server when you drop foo.

and in case when you are trying to drop database using phpmyadmin refer this phpmyadmin enable drop database statement.

Hope this may help you to understand the error.

like image 40
Himanil Gupta Avatar answered Nov 03 '22 03:11

Himanil Gupta


Mysql generate two file for any table

  1. .frm
  2. .ibd

check in your directory for both file must exist, if any one is missing then remove the remaining one or if you wish you can remove all the file, but be careful this my delete all your data from tables.

This works for me, I hope it also works for you too.

like image 1
Alpesh Jikadra Avatar answered Nov 03 '22 03:11

Alpesh Jikadra


  1. Go to

    C:\wampXY\bin\mysql\mysqlx.y.z\data

(XY.. refer versions)

  1. Rename the file you want to delete to anything else.(optional only for special cases)

  2. Now simply delete the renamed file.

like image 1
Hrishikesh Kashyap Avatar answered Nov 03 '22 04:11

Hrishikesh Kashyap