Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to drop database

Tags:

i used the following sytanx

drop database filmo;  

and got the following error:

ERROR 1010 (HY000): Error dropping database (can't rmdir './filmo/', errno: 17) 

any ideas..

like image 605
devang Avatar asked Jan 12 '10 04:01

devang


People also ask

How do I drop a database in SQL?

To do delete a database you need the command 'DROP DATABASE'. The syntax is similar to creating a database. 'DROP DATABASE <name>;', where <name> is the name of the database you want to delete.

Can we drop a database?

System databases cannot be dropped. The DROP DATABASE statement must run in autocommit mode and is not allowed in an explicit or implicit transaction. Autocommit mode is the default transaction management mode. You cannot drop a database currently being used.

Which command is used to drop database?

SQL> DROP DATABASE testDB; NOTE − Be careful before using this operation because by deleting an existing database would result in loss of complete information stored in the database.


2 Answers

It means there are files in that directory not relating to MySQL. Another issue, although I doubt it, is insufficient permissions. You may delete that directory from the filesystem.

like image 149
tanerkay Avatar answered Oct 07 '22 00:10

tanerkay


Got same error. This fixed it for me in Ubuntu 10.04:

stop mysql

rm -rf /var/lib/mysql/XXXXX

start mysql

Where XXXXX is the offending database name.

like image 26
Alex R Avatar answered Oct 07 '22 00:10

Alex R