I think you are out of luck on this one. You can either use the ssh
extension in your PHP code, or if you have access to the server, you
could try to create a ssh tunnel on the command-line.
You probably need special permissions to do that, though. It also
looks like you don’t have ssh access to this hosting account.
duplicate由@jpm回答
Setting up tunneling由@ÓlafurWaage于Connect to a MySQL server over SSH in PHP发布
this one由@Sosy进行隧道掘进
shell_exec(“ssh -f -L 3307:127.0.0.1:3306 user@remote.rjmetrics.com sleep 60 >> logfile”);
$db = mysqli_connect(’127.0.0.1′, ‘sqluser’, ‘sqlpassword’, ‘rjmadmin’, 3307);