- Events in Europe: MySQL - News from Oracle OpenWorld and Beyond
- Astricon: Matt Jordan: Asterisk APIs
- Astricon: Shaun Ruffell: DAHDI
- Astricon: Matt Jordan: Asterisk Developer Tools
- Astricon: Jason Parker: Asterisk Module API
- David Vossell: Asterisk Architecture
- AstriCon: Paul Belanger: Introduction to Asterisk Development
- AstriDevCon final session
- AstriDevCon afternoon session - Asterisk 11
- AstriDevCon Test Framework
- AstriDevCon second morning session
- MySQL.com Security Notice
- Oracle Enhances MySQL Installer and High Availability for Windows
- Asterisk 1.8.6.0 Now Available
MySQLDump To a Remote Server
I was running out of disk space on a server today. The server had a large database table that was no longer used, so I wanted to archive it and then drop the table. But the server didn’t have enough disk space to dump it out to disk before copying it off to a remote server for archiving.
The first thought was to run mysqldump dump on the destination machine, and to access the database over the network. That however, doesn’t compress or encrypt the data. Plus I would have had to create a mysql user with permission to access the database remotely.
The solution I came up with worked out well: mysqldump directly to the remote host with this command:
mysqldump [mysqldump options] | gzip -c | ssh user@remotehost "cat > /path/to/some-file.sql.gz"
That pipes the mysqldump command through gzip, then to through and SSH connection. SSH on the remote side runs the ‘cat’ command to read the stdin, then redirects that to the actual file where I want it saved.
By Brandon Checketts
http://www.brandonchecketts.com/archives/mysqldump-to-a-remote-server
- Login to post comments
