DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

Snippets has posted 5883 posts at DZone. View Full User Profile

Mysql Dump To Another Server

10.02.2007
| 1437 views |
  • submit to reddit
        // Using UNIX pipe concept one can dump database to another server securely using ssh protocol. 
// All you need remote execution rights for the ‘dd’ command, over SSH.

mysqldump -u USERnAME -p'PASSWORD' YOUR-DATABASE-NAME | ssh user@remote.server.com "dd of=/mysql/$(date +'%d-%m-%y')"