You can create mysqldump like this:
user = whatever
password = whatever
host = whatever
Now lets backup a database
mysqldump: [Warnings] Using a password on the command line interface can be insecure.
It’s not the best practice because the password is in a file and not encrypted!
First things first. With this small and simple tar command we archive all our /var/www/ data.
tar -zcvf archive.tar.gz /
Now we dump the MySQL database with the next command.
mysqldump -u root -p databasename >
You will be asked to
write the password for the database user (in this case root).
scp archive.tar.gz root@destinationserver:/root
scp /root/backupname.sql root@destinationserver:/root
Again you will be asked twice for the
password of the remote server but all your sensitive data will be saved there. Again this is a very simple and just a small demonstration of what you can do with tar, scp and ssh. This entry was posted in Linux and tagged gz, how, linux, mysqldump, remote, server, simple, ssh, tar, tar ssh remote backup, to, tutorial on . 14 February, 2021