List:General Discussion« Previous MessageNext Message »
From:aman Date:July 8 2004 6:06pm
Subject:Re: mysqldump
View as plain text  
Assume DB1

$mysqldump -u user DB1 > DB1.sql

Remember if you have a password set for this user (which ideally should
be) use the -p option.

$mysql -u user -e "create database DB2"
This line will create the new database

$mysql -u root DB2 < DB1.sql
This will put all your tables and data into DB2 

In case it is DB1 on the target system - in that case you will need to
follow the last two steps on the target system, having the DB1 file
copied and using DB1 instead of DB2 in those two steps.

Aman Raheja

On Thu, 2004-07-08 at 12:47, leegold wrote:
> Hi,
> Will mysqldump import the entire DB? Including tables and ALL
> the data in the tables? 
> I assume I must "create" the DB on the target system *then* load
> or run the file created by mysqldump? Is there a tutorial on
> this - I get the feeling the man page does not have the
> "soup to nuts" solution.
> Thanks

mysqldumpleegold8 Jul
  • Re: mysqldumpaman8 Jul