I have just bought the unmanaged VPS. I am running a node js application that uses a connection string for mysql database stored somewhere else.
The connection between vps (nodejs web) and mysql server is not successful.
It is successful, when I try a telnet call from my local machine to mysql server. However, when I do a telnet from the VPS SSH to the mysql server it is giving the following error:
r]# telnet 64.XX.XX.XX 3306
Trying 64.XX.XX.XX...
telnet: connect to address 64.XX.XX.XX: Connection timed out
I have tried to set the following firewall ruleset but there is no success.
iptables -L result:
Chain INPUT (policy ACCEPT)
target prot opt source destination
ACCEPT tcp -- anywhere anywhere tcp spt:mysql ctstate ESTABLISHED
ACCEPT tcp -- anywhere anywhere tcp spt:mysql state ESTABLISHED
Chain FORWARD (policy ACCEPT)
target prot opt source destination
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
ACCEPT tcp -- anywhere anywhere tcp dpt:mysql
ACCEPT tcp -- anywhere anywhere tcp dpt:mysql