Código PHP:
Ver original$ssh_server = "xxx.xxx.xxx.xxx";
$ssh_port = "22";
$remote_port = "3306";
$ssh_user = "xxxx";
$ssh_pass = "xxxxxx";
if($ssh_conn){echo "Connection Successful!\n";}
else{echo 'Connection Failed...';die();}
if($ssh_auth){echo "Authentication Successful!\n";}
else{echo 'Authentication Failed...';die();}
$ssh_tunnel = ssh2_tunnel($ssh_conn, $ssh_server,$remote_port); if ($ssh_tunnel){echo "Tunnel created\n";}
else{echo "Tunnel creation failed!!";die();}
//////////////////////////////////////////////////////
// EVERTHING comes back good to this point now I need to connect to mysql
$usr_mysql = 'xxxx';
$pwd_mysql = 'xxxxx';
// HAVE TRIED THIS
$host_mysql = '127.0.0.1';
// HAVE TRIED THIS
$host_mysql = $ssh_tunnel;