cannot drop a database created by xtrabackup

I tested xtrabackup a few weeks ago, and it created a database with the name “#mysql50#xtrabackup-201107011748” in my MySQL v5.1.50 (remi) instance as follows:

mysql

Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 744523
Server version: 5.1.50 MySQL Community Server (GPL) by Remi

Copyright © 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This software comes with ABSOLUTELY NO WARRANTY. This is free software,
and you are welcome to modify and redistribute it under the GPL v2 license

Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the current input statement.

mysql> show databases;
±---------------------------------+
| Database
±---------------------------------+
| information_schema
| mysql
| …
| …
| #mysql50#xtrabackup-201107011748
±---------------------------------+
8 rows in set (0.00 sec)

I am trying to drop this database, and no matter what I do, I just get a syntax error.

I’m sure I’m just being stupid… how do I get rid of this database?

Thanks,
Jay

e.g.
mysql> drop database ‘#mysql50#xtrabackup-201107011748’;
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#xtrabackup-201107011748’’ at line 1
mysql> drop database ‘xtrabackup-201107011748’;
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 ‘‘xtrabackup-201107011748’’ at line 1

The object name includes unallowed characters for unquoted identifiers, to drop it you will have to quote it:

DROP DATABASE #mysql50#xtrabackup-201107011748;

http://dev.mysql.com/doc/refman/5.1/en/identifiers.html

viiin wrote on Wed, 03 August 2011 00:39

Thanks for the suggestion viiin. Here’s what I get -

Quote:

Uh oh. Now what?
-Jay