# cannot drop a database created by xtrabackup

**URL:** <https://forums.percona.com/t/cannot-drop-a-database-created-by-xtrabackup/2161>\
**Category:** Percona XtraBackup\
**Created:** [August 2, 2011, 5:16am UTC](https://forums.percona.com/t/cannot-drop-a-database-created-by-xtrabackup/2161 "2011-08-02T05:16:40Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![libove](https://avatars.discourse-cdn.com/v4/letter/l/779978/32.png) [@libove](https://forums.percona.com/u/libove)\
**Post date:** [August 2, 2011, 5:16am UTC](https://forums.percona.com/t/cannot-drop-a-database-created-by-xtrabackup/2161/1 "2011-08-02T05:16:40Z")

</div>

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 (c) 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

---

<div class="post-metadata">

**Author:** ![revin](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/revin/32/824_2.png) [@revin](https://forums.percona.com/u/revin)\
**Post date:** [August 2, 2011, 5:09pm UTC](https://forums.percona.com/t/cannot-drop-a-database-created-by-xtrabackup/2161/2 "2011-08-02T17:09:40Z")

</div>

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

DROP DATABASE `#mysql50#xtrabackup-201107011748`;

[URL][http://dev.mysql.com/doc/refman/5.1/en/identifiers.html[/URL]](http://dev.mysql.com/doc/refman/5.1/en/identifiers.html%5B/URL%5D)

---

<div class="post-metadata">

**Author:** ![libove](https://avatars.discourse-cdn.com/v4/letter/l/779978/32.png) [@libove](https://forums.percona.com/u/libove)\
**Post date:** [August 2, 2011, 5:13pm UTC](https://forums.percona.com/t/cannot-drop-a-database-created-by-xtrabackup/2161/3 "2011-08-02T17:13:14Z")

</div>

viiin wrote on Wed, 03 August 2011 00:39

> [@](#):
>
> 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](https://http)

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

Quote:

> [@](#):
>
> mysql\> show databases;  
> ±---------------------------------+  
> | Database  
> ±---------------------------------+  
> | information\_schema  
> | mysql  
> | …  
> | #mysql50#xtrabackup-201107011748  
> ±---------------------------------+  
> 8 rows in set (0.00 sec)
> 
> mysql\> drop database `#mysql50#xtrabackup-201107011748`;  
> ERROR 1008 (HY000): Can’t drop database ‘#mysql50#xtrabackup-201107011748’; database doesn’t exist

Uh oh. Now what?  
-Jay
