PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Autres forums > Forum Programmation & Conception > comp.databases.mysql > database has a semicolon
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
database has a semicolon

Réponse
 
LinkBack Outils de la discussion
Vieux 07/01/2008, 14h42   #1
Reacher
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut database has a semicolon

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
  Réponse avec citation
Vieux 07/01/2008, 14h46   #2
Rik Wasmus
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: database has a semicolon

On Mon, 07 Jan 2008 15:42:11 +0100, Reacher <brandon.g.jones@gmail.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
  Réponse avec citation
Vieux 07/01/2008, 14h49   #3
Luuk
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: database has a semicolon


"Reacher" <brandon.g.jones@gmail.com> schreef in bericht
news:d5996c0a-c3dd-4a8f-8415-7ed06f109457@c4g2000hsg.googlegroups.com...
>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;`;



  Réponse avec citation
Vieux 07/01/2008, 14h50   #4
Reacher
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: database has a semicolon

On Jan 7, 8:46am, "Rik Wasmus" <luiheidsgoe...@hotmail.com> wrote:
> On Mon, 07 Jan 2008 15:42:11 +0100, Reacher <brandon.g.jo...@gmail.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)
  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 22h41.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,09844 seconds with 12 queries