Saturday 6 April 2013

Solution: Unable to access mysql server of Amazon ec2 instance remotely



If you have problem in accessing mysql server server publicly or remote even in the security group if you open mysql port 3306 in inbound rules. to solve this problem simply stop iptables.

First check port 3306 whether it is Listining or not 
[root@ip-10-142-194-252 ~]# netstat -ant
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address               Foreign Address             State
tcp        0      0 0.0.0.0:3306                0.0.0.0:*                   LISTEN
tcp        0      0 0.0.0.0:40972               0.0.0.0:*                   LISTEN
tcp        0      0 0.0.0.0:111                 0.0.0.0:*                   LISTEN
tcp        0      0 0.0.0.0:22                  0.0.0.0:*                   LISTEN
tcp        0      0 127.0.0.1:631               0.0.0.0:*                   LISTEN
tcp        0      0 127.0.0.1:25                0.0.0.0:*                   LISTEN
tcp        0    248 10.142.194.252:22           117.213.139.76:1086         ESTABLISHED
tcp        0      0 :::111                      :::*                        LISTEN
tcp        0      0 :::80                       :::*                        LISTEN
tcp        0      0 :::22                       :::*                        LISTEN
tcp        0      0 ::1:631                     :::*                        LISTEN
tcp        0      0 :::55704                    :::*                        LISTEN

Now stop iptables
[root@ip-10-142-194-252 ~]# service iptables stop;
iptables: Flushing firewall rules:                         [  OK  ]
iptables: Setting chains to policy ACCEPT: filter          [  OK  ]
iptables: Unloading modules:                               [  OK  ]
[root@ip-10-142-194-252 ~]#

I think now you can access.

Share This!



No comments:

Post a Comment

Here We Write The Problems we face at different situations and Solutions to those problems.