mysqldump directly to another server, mysqldump redirect to scp

mysql-logo-imageIt’s not a big deal to perform mysqldump command, get your database as a file and transfer MySQL database to another server by moving the file to another server and import it,

But what if there is no enough space on a disk to store the dump file? In this case it would be great to create MySQL dump file directly on the remote server. And not only you can create dump file directly but even clone a database to remote MySQL! Here I show how to do this.

mysqldump directly to remote mysql clone

Issue the following command:

Here we make a pipe and pump the dump directly into mysql on the remote server, essentially cloning the database is one command!

mysqldump directly to remote server in a dump file

Issue the following command:

This command will perform mysqldump and the dump file will be created directly on the remote server!

The variation of the above in case we want to initiate mysqldumpon the remote server:

Good luck!

Want me to do this for you? Drop me a line: itgalaxyzzz {at} gmail [dot] com