RE: Are you serious? mySQL 5.0 does NOT have a RENAME DATABASE?

2009-12-11 Thread Daevid Vincent
nan [mailto:suzuki_b...@yahoo.com] > Sent: Friday, December 11, 2009 2:02 PM > To: MySql; Michael Dykman > Subject: Re: Are you serious? mySQL 5.0 does NOT have a > RENAME DATABASE? > > if you have myisam alone tables you can rename the folder of > the database. That can work

RE: Are you serious? mySQL 5.0 does NOT have a RENAME DATABASE?

2009-12-11 Thread Gavin Towey
t: Re: Are you serious? mySQL 5.0 does NOT have a RENAME DATABASE? if you have myisam alone tables you can rename the folder of the database. That can work like rename database. If you have innodb table you have to move one by one table because details of those tables will be stored in innodb s

Re: Are you serious? mySQL 5.0 does NOT have a RENAME DATABASE?

2009-12-11 Thread Saravanan
--- On Fri, 12/11/09, Michael Dykman wrote: From: Michael Dykman Subject: Re: Are you serious? mySQL 5.0 does NOT have a RENAME DATABASE? To: "MySql" Date: Friday, December 11, 2009, 10:54 PM No, not a loophole.  Just a plain-old management feature..  there is nothing particularly hack

Re: Are you serious? mySQL 5.0 does NOT have a RENAME DATABASE?

2009-12-11 Thread Johan De Meersman
On Fri, Dec 11, 2009 at 10:40 PM, Daevid Vincent wrote: > Will this work in 5.0? > Yes. > If I'm reading this right, it seems like this is some kind of trick or > loophole then right? If it works and solves my dilemna, I'm fine with that, > but I'm just curious. > Not really, this is by desig

Re: Are you serious? mySQL 5.0 does NOT have a RENAME DATABASE?

2009-12-11 Thread Michael Dykman
; Sent: Friday, December 11, 2009 6:08 AM >> To: MySql >> Subject: Re: Are you serious? mySQL 5.0 does NOT have a >> RENAME DATABASE? >> >> If you want to move the database atomically,  a RENAME TABLE statement >> may have multiple clauses. >> >> RENA

RE: Are you serious? mySQL 5.0 does NOT have a RENAME DATABASE?

2009-12-11 Thread Daevid Vincent
mv' command where it simply changing pointers or is it a full on copy/rm? (Assume same filesystem/directory) > -Original Message- > From: Michael Dykman [mailto:mdyk...@gmail.com] > Sent: Friday, December 11, 2009 6:08 AM > To: MySql > Subject: Re: Are you serious? mySQ

Re: Are you serious? mySQL 5.0 does NOT have a RENAME DATABASE?

2009-12-11 Thread Michael Dykman
According to MySQL docs, it should still work atomically. Granted, I have only used this particular trick when they are on the same filesystem. Copying across filesystems, I imagine it should still be atomic, but your system may be locked for awhile. Obviously, a dedicated RENAME DATABASE comman

Re: Are you serious? mySQL 5.0 does NOT have a RENAME DATABASE?

2009-12-11 Thread Jim Lyons
Can you use that syntax if the databases are on different file systems? If you can, and the original table is big, the command would take a while as it moved data from one file system to another. On Fri, Dec 11, 2009 at 7:58 AM, Johan De Meersman wrote: > On Fri, Dec 11, 2009 at 1:56 PM, Ken D'A

Re: Are you serious? mySQL 5.0 does NOT have a RENAME DATABASE?

2009-12-11 Thread Michael Dykman
If you want to move the database atomically, a RENAME TABLE statement may have multiple clauses. RENAME TABLE olddb.foo to newdb.foo, olddb.bar to newdb.bar; Here, I hot-swap a new lookup table 'active.geo' into a live system confident that, at any given point, some version of this t

Re: Are you serious? mySQL 5.0 does NOT have a RENAME DATABASE?

2009-12-11 Thread Johan De Meersman
On Fri, Dec 11, 2009 at 1:56 PM, Ken D'Ambrosio wrote: > > rename table oldschema.table to newschema.table; > > Just to be 100% clear -- I assume you have to first create the destination > database, and then do this for all the tables in the source database? > Yep. Easily scriptable, though :-)

Re: Are you serious? mySQL 5.0 does NOT have a RENAME DATABASE?

2009-12-11 Thread Ken D'Ambrosio
On Fri, December 11, 2009 7:38 am, Johan De Meersman wrote: > This only works for MyISAM :-) Good to know -- thanks! > However, there's another solution where you don't need to shut down, and > that works for any engine afaik: > > rename table oldschema.table to newschema.table; Just to be 100%

Re: Are you serious? mySQL 5.0 does NOT have a RENAME DATABASE?

2009-12-11 Thread Johan De Meersman
This only works for MyISAM :-) However, there's another solution where you don't need to shut down, and that works for any engine afaik: rename table oldschema.table to newschema.table; I agree that it's a silly thing to not have, but I can't say that I've encountered a whole lot of instances wh

Re: Are you serious? mySQL 5.0 does NOT have a RENAME DATABASE?

2009-12-10 Thread Ken D'Ambrosio
Uhhh... wow. Unless I'm very, very, very mistaken, I think you're missing something pretty obvious: I believe you can simply a) shut down the database b) mv the directory to a different directory name. *DONE* Your database now has a different name. Boy, that 30 seconds of hard labor was sure fa

Are you serious? mySQL 5.0 does NOT have a RENAME DATABASE?

2009-12-10 Thread Daevid Vincent
How can it possibly be that mySQL doesn't allow you to rename a database? I can't fathom how this can be a difficult task at all to do. Aren't mySQL databases stored in a directory of the DB name? And for INNODB, can't you just find the spot in the ibdata file and alter whatever needs to be changed