dbTalk Databases Forums  

database has a semicolon

comp.databases.mysql comp.databases.mysql


Discuss database has a semicolon in the comp.databases.mysql forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
Reacher
 
Posts: n/a

Default database has a semicolon - 01-07-2008 , 09:42 AM






I have a database in MYSQL that has a semicolon on the end. ie:

Quote:
show databases;
....
db1
db2
mytestdb;
db3
....
Quote:
I can't seem to drop this database, since the semicolon is part of the
name. I've tried escaping it and passing the database name as a
quoted string, neither of which worked. Does anyone know the syntax
I'd need to drop this database?

Thanks!
b


Reply With Quote
  #2  
Old   
Rik Wasmus
 
Posts: n/a

Default Re: database has a semicolon - 01-07-2008 , 09:46 AM






On Mon, 07 Jan 2008 15:42:11 +0100, Reacher <brandon.g.jones (AT) gmail (DOT) com>
wrote:

Quote:
I have a database in MYSQL that has a semicolon on the end. ie:

show databases;
...
db1
db2
mytestdb;
db3
...


I can't seem to drop this database, since the semicolon is part of the
name. I've tried escaping it and passing the database name as a
quoted string, neither of which worked. Does anyone know the syntax
I'd need to drop this database?
DROP DATABASE `mytestdb;`;

Notice the backticks (`) instead of single quotes (').
--
Rik Wasmus


Reply With Quote
  #3  
Old   
Luuk
 
Posts: n/a

Default Re: database has a semicolon - 01-07-2008 , 09:49 AM




"Reacher" <brandon.g.jones (AT) gmail (DOT) com> schreef in bericht
news:d5996c0a-c3dd-4a8f-8415-7ed06f109457 (AT) c4g2000hsg (DOT) googlegroups.com...
Quote:
I have a database in MYSQL that has a semicolon on the end. ie:

show databases;
...
db1
db2
mytestdb;
db3
...


I can't seem to drop this database, since the semicolon is part of the
name. I've tried escaping it and passing the database name as a
quoted string, neither of which worked. Does anyone know the syntax
I'd need to drop this database?

Thanks!
b
drop datavase `testdb;`;





Reply With Quote
  #4  
Old   
Reacher
 
Posts: n/a

Default Re: database has a semicolon - 01-07-2008 , 09:50 AM



On Jan 7, 8:46*am, "Rik Wasmus" <luiheidsgoe... (AT) hotmail (DOT) com> wrote:
Quote:
On Mon, 07 Jan 2008 15:42:11 +0100, Reacher <brandon.g.jo... (AT) gmail (DOT) com> *
wrote:

I have a database in MYSQL that has a semicolon on the end. *ie:

show databases;
...
db1
db2
mytestdb;
db3
...

I can't seem to drop this database, since the semicolon is part of the
name. *I've tried escaping it and passing the database name as a
quoted string, neither of which worked. *Does anyone know the syntax
I'd need to drop this database?

DROP DATABASE `mytestdb;`;

Notice the backticks (`) instead of single quotes (').
--
Rik Wasmus
Thanks! Rails actually put the semicolon in there in the first place
(someone had them in the YAML file)


Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.