Forum: Ruby Creating Duplicate MySQL Database

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Chris (Guest)
on 2006-06-09 01:45
I've done it once before and cannot find the command to do it.

I'm looking for a SQL command which will spit out the sql statements to
create an existing database.  All its tables and everything.  So I can
then take that code and create another database with a different name,
but which is basically a mirror image of the original, minus the data.

Thanks in advance,
Chris
Sean C. (Guest)
on 2006-06-09 01:59
(Received via mailing list)
On 6/8/06, Chris <removed_email_address@domain.invalid> wrote:
>
> I've done it once before and cannot find the command to do it.
>
> I'm looking for a SQL command which will spit out the sql statements to
> create an existing database.  All its tables and everything.  So I can
> then take that code and create another database with a different name,
> but which is basically a mirror image of the original, minus the data.


I believe you are looking for the mysqldump command.  It isn't sql but
it
outputs the sql to construct a database.  (mysqldump -u=user -p=password
app_development)

Sean C.
Vrtwo L. (Guest)
on 2006-06-09 04:08
(Received via mailing list)
somehting along these lines:

mysqldump -u <user> -p <pass> <database> > backup.sql
mysql -u <user> -p <pass> <new_database> < backup.sql
This topic is locked and can not be replied to.