msgbartop
A chronological documentation test project, nothing serious, really!
msgbarbottom

07 May 2007 Copying One mySQL database from one machine to another

Posted by

# mysqldump -h host.com  -u root -p password sourceDB | mysql -h host2.com -u username -p password -C targetDB

Interestingly, you don’t actually have be on the ‘source’ machine thanks to mySQL’s -h switch. From the target machine, simply specify the remote host after the -h. This was quite useful for me as my source machine didn’t have mysqldump installed.

Tags: , ,

Comments are closed.