How to backup MySQL to remote ssh server using mysqldump command

June 16, 2016 | By | Reply More

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)

Example:

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

Explanation:

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 10.34.0.10 server.

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

Tags: , ,

Category: Server

Leave a Reply