i have a database server ( MySQL ) that does not have enough free space to save dump of MySQL. i want to create dump on it and send to archive server straight without save on local host because lack of space. how can i do this on my local database server ? all of my servers are Linux base. thanks in advance
CodePudding user response:
You can do it like this:
mysqldump -u MYSQL_USER -p'MYSQL_PASSWORD' YOUR_DATABASE | gzip -c | ssh you@your_host 'cat > ~/backup.sql.gz'