If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > Mysql 4: Invalid database name

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 02-18-09, 07:24
fopetesl fopetesl is offline
Registered User
 
Join Date: Feb 2009
Posts: 2
Question Mysql 4: Invalid database name

"show databases"
Code:
Databases
usernames.May2007
usernames.June2007
usernames
When I execute "use usernames.May2007" I get error:
Code:
Error 1102 (42000) : Invalid database name 'usernames.May2007'
I don't now need to keep the '..2007' databases but how do I delete them?
I get a similar error when I use drop usernames.May2007
Reply With Quote
  #2 (permalink)  
Old 02-18-09, 08:06
mike_bike_kite mike_bike_kite is offline
vaguely human
 
Join Date: Jun 2007
Location: London
Posts: 2,519
The "." is treated as a special character in SQL to distinguish between a database and a table or a table and a field ie
Code:
select * from MyDatabase.MyTable
So it's a poor idea to use the "." within the database name itself. You could try enclosing the whole database name in backticks to tell MySQL that you really do mean it's the name of a database.
Code:
use `usernames.May2007`;

drop database `usernames.May2007`;
Next I'd rename you're databases to something like usernames200706. Why are you storing your user names in a backup database anyway?
Reply With Quote
  #3 (permalink)  
Old 02-18-09, 08:41
fopetesl fopetesl is offline
Registered User
 
Join Date: Feb 2009
Posts: 2
Thumbs down

The reason both for the "backups" and the *.* is that they are inherited from my predecessor
The main database 'usernames' is now backed up regularly to Flash Drive.

The suggestion
drop database `usernames.May2007`;
comes up with the "Incorrect database name" error. That's using *`* back tick?
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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On