MySQL 5.1 Reference Manual  /  ...  /  Making a Copy of a Database Making a Copy of a Database

shell> mysqldump db1 > dump.sql
shell> mysqladmin create db2
shell> mysql db2 < dump.sql

Do not use --databases on the mysqldump command line because that causes USE db1 to be included in the dump file, which overrides the effect of naming db2 on the mysql command line.

Download this Manual
User Comments
Sign Up Login You must be logged in to post a comment.