Closed havefive closed 5 years ago
$connection = ssh2_connect('111.118.182.147', 22); ssh2_auth_password($connection, 'root', 'HHYDHN@146#53'); $tunnel = ssh2_tunnel($connection, '111.118.182.147', 3306); $DbConnection = new mysqli_connect('111.118.182.147', 'root', 'mysql', 'test_db', 3306, $tunnel) or die ('Fail: '.mysql_error()); echo "DbCon=".$DbConnection;
I am not sure, this code has not been tested on 7.2
$connection = ssh2_connect('111.118.182.147', 22); ssh2_auth_password($connection, 'root', 'HHYDHN@146#53'); $tunnel = ssh2_tunnel($connection, '111.118.182.147', 3306); $DbConnection = new mysqli_connect('111.118.182.147', 'root', 'mysql', 'test_db', 3306, $tunnel) or die ('Fail: '.mysql_error()); echo "
DbCon=".$DbConnection;