From: Michael Dykman Date: December 11 2009 2:08pm Subject: Re: Are you serious? mySQL 5.0 does NOT have a RENAME DATABASE? List-Archive: http://lists.mysql.com/mysql/219662 Message-Id: <814b9a820912110608h5c1bf24ex20514d29a252e686@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 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 table always exists: RENAME TABLE active.geo to archive.geo, standby.geo to active geo; - michael dykman On Fri, Dec 11, 2009 at 8:58 AM, Johan De Meersman wrote: > 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 :-) > -- - michael dykman - mdykman@stripped "May you live every day of your life." Jonathan Swift Larry's First Law of Language Redesign: Everyone wants the colon.