I am trying to connect to an external mysql server from a computer which is inside a vlan where my application will run. The remote server is not a member of the vlan. The following is what I have tried so far.
Mysql Port forwarding from my vlan server
ssh -L 3306:my-vlan-server-ip:3306 user-at-external-server@external-server-ip
In this case I get a ssh timeout message. Tried to do it directly from my php mysql_connect I get mysql error #111 yet I have already edited the my.cnf as:
#skip-networking
bind-address =my-vlan-server-ip
My php db connect script
<?php
$conn=mysql_connect("external-server-ip","user","pass");
if($conn)
{
echo "success";
}
else
{
echo "fail";
}
?>
Kindly someone help.Let me know where I am going wrong. Thanks.