MysqlDump directly on mounted remote directory (CENTOS, Linux, Unix)

If you don’t have space to write a dump file, or want to directly send your SQL to another server (without intermediate transfers), using a remotely mounted folder is a way to go.

There are various mounting options such as:

  • NFS
  • Windows Shares (SAMBA)

A quick example using SSHFS:

$ sudo sshfs -o rw user@remoteIP:/local_folder_to_mount_to/some_folder /   remote_folder_to_mount_to/some_folder

$ mysqldump --user=root --password=your_password database_name >> /local_folder_to_mount_to/some_folder/mysql_dump_file.sql

You will need to install the appropriate packages either using apt or yum (depending on your system).

$ sudo apt-get install sshfs
$ sudo yum install sshfs

Menelaos Bakopoulos

Mr. Menelaos Bakopoulos is currently pursuing his PhD both at Center for TeleInFrastruktur (CTiF) at Aalborg University (AAU) in Denmark and Athens Information Technology (AIT) in Athens, Greece. He received a Master in Information Technology and Telecommunications Systems from Athens Information Technology and a B.Sc. in Computer Science & Management Information Systems from the American College of Thessaloniki. Since April 2008 he has been a member of the Multimedia, Knowledge, and Web Technologies Group.

More Posts