0

If I needed to gzip a remote database and import it into my WAMP MySQL database I believe the command I should use is -

ssh user@server "mysqldump ericdev | gzip" | gunzip | mysql ericcart

But how would I run this locally when Putty requires me to connect to a server first and I can't SSH into WAMP.

2
  • Do you have phpMyAdmin access?
    – RiggsFolly
    Jan 20, 2015 at 21:19
  • I do, the DB I am trying to gzip over is a GB though so I'd like to not have to export, download, import if at all possible
    – Eric
    Jan 21, 2015 at 22:12

1 Answer 1

0

Have you give this a try yet? It should work. Pay attention to the quotation marks. I'll add some parenthesis for clarity:

(ssh user@server "mysqldump ericdev | gzip") | gunzip | mysql ericcart

So, the first command, ssh user@server "mysqldump ericdev | gzip", returns a gzipped DB. That gzipped DB is then piped into gunzip and mysql commands. The ssh command is only for the remote server.

Edit: I completely missed the point of the question, let me try again. (Thanks, @RiggsFolly)

You are going to want to install cygwin. Cygwin lets you run lots of repackaged linux utilities on Windows, SSH included. Go through the Cygwin setup and choose SSH under the "Net" section (search for it if you need to). After you've installed it, you should be able to open up the Cygwin console and run the ssh command.

So that you don't have to use the Cygwin console, I highly recommend adding the Cygwin Bin directory to the system path. You may need to reboot after doing that, but you should be able to run your original command right in command prompt or Powershell.

6
  • If he cannot SSH into the server running WAMP ( because it is a windows machine and they dont have an ssh server by default ) How is that going to help??
    – RiggsFolly
    Jan 20, 2015 at 21:17
  • @RiggsFolly Facepalm I completely missed the point of this. Updating now...
    – dotbat
    Jan 20, 2015 at 21:43
  • LOL Better, but that puts a SSH client on the WorkStation, it does not put an SSH server on the WAMPServer machine. I am assuming (s)he does not have access to the server machine or this would not be an issue.
    – RiggsFolly
    Jan 20, 2015 at 23:56
  • @RiggsFolly I was thinking that there is a remote server with the MySQL Database and Eric has WAMP running locally. Eric, do you have WAMP locally? What is the server running? (I can't directly comment on his post yet...)
    – dotbat
    Jan 21, 2015 at 13:23
  • Thanks for all the assistance you guys trying this now. WAMP is installed locally.
    – Eric
    Jan 21, 2015 at 20:59

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .