Activities

July 2011
M T W T F S S
« Jun   Aug »
 123
45678910
11121314151617
18192021222324
25262728293031

ERROR 1010 (HY000): Error dropping database (can’t rmdir ‘./test/’, errno: 17)

Recently I had to drop a huge database before talking a mysql hot copy backup. I got an error while I’m executing drop database statement in mysql and I can see that database name is still exists there even though there were empty tables in it or sometimes few tables may have there.

ERROR 1010 (HY000): Error dropping database

This is like a weird situation and I done the database restart but noting won’t work for me. Database entry still exists. Some threads pointing to me that it’s sometime issue with the file permission issue. So I’m thinking on the same track.

The default permission sets required for mysql user in Mysql data directory is

 # chown -R mysql.mysql /var/lib/mysql
#chmod -R 700 /var/lib/mysql

It’s possible to remove the MySQL database folder since I’m using “innodb_file_per_table=1” option in my.cnf” with innodb storage engine support.

Solution :
a. Stopped the mysql service
b. remove the mysql database folder in data directory
c. restart the mysqld service

Note : innodb_file_per_table would help to create each table entry has separate innodb file and this may very useful if the table may have GB of data.

That’s it !!!

Leave a Reply

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>