Here’s a simple answer to a simple question. “How do I run a backup of MySQL to another machine without writing to the local server’s filesystem?” – this is especially useful if you are running out of space on the local server and cannot write a temporary file to the filesystem during backups.
Method one – this writes a remote file.
mysqldump [options] [db_name|--all-databases]| gzip -c | ssh firstname.lastname@example.org "cat > /path/to/new/file.sql.gz"
Method two – this writes directly into a remote mysql server
mysqldump [options] [db_name|--all-databases]| mysql --host=[remote host] â€“user=root â€“password=[pass] [db_name]