Using mysqldump to copy databases : Mysqldump : MySQL Utilities MySQL TUTORIALS


MySQL TUTORIALS » MySQL Utilities » Mysqldump »

 

Using mysqldump to copy databases


It is possible to combine a dump and a restore on one line by using a pipe '|' to pass the output of the dump directly to mysql basically bypassing the file.

We can use this method to copy a database to another server or even create a duplicate copy.

For example to copy the 'myDatabase' database to a mysql server called 'remote.server.com':

c:mysqlbinmysqldump -u root -p --databases myDatabase | 
> mysql -u backup -p MyPassword -h remote.server.com

The "" at the end of the first line means you wish to contine the command on another line before executing it.




Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .

Follow Navioo On Twitter

MySQL TUTORIALS

 Navioo MySQL Utilities
» Mysqldump