How to backup MySQL to remote ssh server using mysqldump command

Mysqldump is a simple, powerful backup utility for MySQL server. With this mysqldump command we can export or backup the entire MySQL server database with a single command. We can save the exported sql file into local directory or even we can save it to remote server via ssh.

This tutorial is going to show you how to perform MySQL backup using mysqldump command to remote ssh server. Before we go through, you will need the following information in hands:

  • MySQL root password
  • remote server access credentials (user name and password to login via ssh)


I would like to backup my MySQL databases to my remote server with IP address Here is the command:


The command above execute mysqldump command with user root and password 12345. It will backup all the database on the MySQL Server and compress them using gzip into /tmp/backup.sql.gz file in server.

Its pretty cool way to backup all the MySQL databases in a single command to a remote server via SSH. Try it.


Leave a Reply

Your email address will not be published. Required fields are marked *