delete a MySQL database with a strange name

0

I started to maintain a MySQL database and I have no idea who and why this database was created: "#mysql50#backup-2012-03-01". I want to get rid of this one, but the following commands did not work:

mysql> drop database `#mysql50#backup-2012-03-01`;

ERROR 1010 (HY000): Error dropping database (can't rmdir './backup-2012-03-01/', errno: 17)

mysql> drop database #mysql50#backup-2012-03-01;

ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1

mysql> drop database "#mysql50#backup-2012-03-01";

ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '"#mysql50#backup-2012-03-01"' at line 1 If somebody can tell me why this database was generated, that's OK, but if not, could you just tell me how to delete it?

Thank you in advance!

fanchyna

Posted 2014-01-23T16:19:06.103

Reputation: 141

Answers

0

This first command is the correct one. The problem is likely non-database files in the database directory which MySQL will not remove. You need to manually navigate to the folder and remove the files/directory and the database will disappear.

If you left your my.cnf with default settings the data will be in something like /var/lib/mysql You'll probably need root privileges to get in there.

Rudu

Posted 2014-01-23T16:19:06.103

Reputation: 248