Page 1 of 1

How to SSH from XAMPP to Server?

PostPosted: 12. July 2015 20:49
by redknigh6
Hi,
I am trying to do a MySQL replication of a remote Master DB with my local Slave DB on XAMPP.
The problem is the Remote Master can only be accessed using SSH to tunnel into the server to access the MySQL DB.
How can I do that from XAMPP. I tried the "ssh" command from the shell but it is not recognized. Do I need to install an add-on for SSH?
Is what I am trying to do possible with XAMPP? Is there a easier way?

I am running XAMPP on Windows 7.

Thanks,

Re: How to SSH from XAMPP to Server?

PostPosted: 12. July 2015 21:51
by glitzi85
As far as I know there is no built-in ssh support in MySQL. Also ssh is not part of windows. You need an client, I think the most popular one for windows is putty: http://www.chiark.greenend.org.uk/~sgta ... nload.html

If you need to automate the whole thing (e.g. you are running the XAMPP MySQL Server as a windows service) then this is going to be a bit more tricky. I've found a tool that seems to run as a service and builds a ssh connection in the background using plink: http://nemesis2.qx.net/pages/MyEnTunnel However, I just found this by googling, I did not try it!

In all cases I would strongly recommend using Public-Key-Authentication for SSH instead of Passwords, especially in scripting this will make your life so much easier.

Re: How to SSH from XAMPP to Server?

PostPosted: 15. July 2015 05:45
by redknigh6
Thanks for the advises, I ended up using PuTTY to do the SSH and Public-Key Auth.
To automate, I just had PuTTY and XAMPP load on Windows startup. PuTTY freeze up sometime at startup (not sure why) so it's kind of annoying.
Will probably move away from Windows to do all this soon.

Re: How to SSH from XAMPP to Server?

PostPosted: 15. July 2015 22:58
by glitzi85
Moving away from Windows sounds like a good idea in this case. In the meantime have a look at plink (same download page as putty), it is the command line interface intended to run in an automated environment.