Creating Duplicate MySQL Database

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

On 6/8/06, Chris [email protected] 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.

somehting along these lines:

mysqldump -u -p > backup.sql
mysql -u -p <new_database> < backup.sql