php – Connecting to mysql over ssh tunnel on Windows


There is a server with MySQL , and you need to connect to it on a client created in php devel studio . I want to make a connection via an ssh tunnel, on Unix it can be done like this:

shell_exec("ssh -f -L sleep 60 >> logfile");  
$db = mysqli_connect("", "sqluser", "sqlpassword", "rjmadmin", 3307);  

But the client will work on Windows, how can you do the same without using additional programs? Or maybe there is some kind of component in devel studio for this purpose?


putty can be used from the windows command line, something like this:

shell_exec("putty.exe -ssh -L");
Scroll to Top