Linux - Backup all mysql databases to individual files on a remote server, Copy mysql databases to a remote server

Backup all mysql databases to individual files on a remote server



Shell script to Backup all mysql databases to individual files on a remote server


for I in $(mysql -e 'show databases' -u root --password=root -s --skip-column-names); do mysqldump -u root --password=root $I | gzip -c | ssh user@server.com "cat > /remote/$I.sql.gz"; done


It grabs all the database names granted for the $MYSQLUSER and gzip them to a remote host via SSH.

This shell script is very much helpful to backup the mysql database. It will just backup the mysql database.

The topic on Linux - Backup all mysql databases to individual files on a remote server is posted by - Math

Hope you have enjoyed, Linux - Backup all mysql databases to individual files on a remote serverThanks for your time

Tech Bluff