In order to run a mysqldump from one host to another over SSH you can run:
mysqldump dbname | ssh root@remotehost.com "mysql -D dbname"
This will pipe the output of mysqldump directly to the ssh connection which is running MySQL at the other end and receiving the mysqldump from standard input.
Running mysqldump via ssh (direct host to host copy)
About Paul Maunders
Subscribe
2 Responses to Running mysqldump via ssh (direct host to host copy)
Leave a Reply Click here to cancel reply.
Recent Tweets
Follow @paulmaunders on Twitter
Blogroll
- 5D Photography
- Aldershot Business
- Alex Polski
- Andrew Thompson
- Ben Kennish
- Brendan McLoughlin
- Camberley Business Listings
- Clearbooks Online Accounting
- Farnborough Businesses
- Farnham Business Directory
- Fleet Businesses
- Fubra Blog
- Harry Ford
- Jake Brumby
- Matt Godwin
- Matt Ward
- Mike Moate
- News Archive
- Pyrosoft
- St Lucia Apartments Blog
- Steve Whiteley
- The New Pink
- The Shaggy Entrepreneur
- Tour The World
- UK Surf News
- Xtra Gamer







What if I’m using Putty to ssh from windows to a linux server? i.e. my command line command isn’t:
>>> ssh
rather:
>>>putty -load “[my saved session]”
I ask because when I run the foregoing, it won’t let me tack on a command to run once the connection is established.
Looks like someone on stackoverflow.com answered it for me: http://stackoverflow.com/questions/6564882/automate-mysqldump-to-local-computer-windows