MySQL Forums
Forum List  »  Newbie

Re: Store dump from DB on Server A to Server B (File) and test restore on C
Posted by: Rick James
Date: October 01, 2012 07:31PM

First, a mini-lesson in shell syntax.

foo | bar
"pipes" the output of foo to bar. That is, whatever foo writes is treated as input to bar.

foo >filex
Sends the output from program foo to the file "filex".

bar <filex
gives the program bar the data that is in filex.

mysqldump's output is the interesting stuff.
mysql's input can be the output from mysqldump.

So...
To dump and reload in one step:
mysqldump ... | mysql ...
Note: No redirecting of output/input to/from any files.

Alternatively, doing it in 2 steps (and using some disk space for the file "dump.sql"):
mysqldump ... >dump.sql
mysql ... <dump.sql

Options: ReplyQuote


Subject
Written By
Posted
Re: Store dump from DB on Server A to Server B (File) and test restore on C
October 01, 2012 07:31PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.