When I am trying to connect to RDS from my vps, it says connection refused. When I tried connecting it from local or other vps, it worked fine.
I figured out that it must be a firewall issue on my vps.
sudo iptables -L
Chain INPUT (policy ACCEPT)
target prot opt source destination
Chain FORWARD (policy ACCEPT)
target prot opt source destination
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
I get this output when I run iptables -L.
this command - netstat -ntlp | grep 3306 gives -
tcp6 0 0 :::3306 :::* LISTEN
What is it that went wrong here?
EDIT: As mentioned by Andrey, I tried to telnet. This is the output that I get.
Trying <<ip_address>>...
telnet: connect to address <<ip_address>>: Connection timed out
EDIT2: Result of netstat on other instance where things are working fine.
tcp 0 0 0.0.0.0:3306 0.0.0.0:* LISTEN 28864/mysqld
I am guessing the problem is with IPv4 and v6? How can I move that port to listen to v4?
netstaton an RDS machine, and the output ofnetstatabove has to be from a different system and not relevant to the question. Also, security group settings on the RDS will never trigger "connection refused" -- only "connection timed out." – Michael - sqlbot Feb 18 '16 at 23:51Trying <<ip_address>>... telnet: connect to address <<ip_address>>: Connection timed out– nirvair Feb 20 '16 at 08:10netstat -ntlp | grep 3306. This instance where things are not working, it is listening totcp6; whereas on other instance where things are working, is listening totcp. – nirvair Feb 24 '16 at 07:20