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 user@host.com "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]