I'm trying to connect to port 3306 on an Ubuntu box and am unable to do so. When I do iptables -L -n | grep 3306
I see this:
ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:3306
ACCEPT udp -- 0.0.0.0/0 0.0.0.0/0 udp dpt:3306
So it looks like I should be able to connect.
Are there any rules that I should look for that could undo these? In my cursory glance I didn't see any. Plus, when I do grep 80
and grep 443
I see pretty much the same thing as above, but with 80 and 443 instead of 3306. And I'm able to connect on ports 80 and 443 even tho I'm not able to connect on port 3306.
The webserver is hosted on rackspace's cloud. I know AWS has additional firewall rules independent of the OS that can be set - does rackspace? I wasn't able to find any in going through the menu and my Google searches haven't proven very fruitful either.
netstat -tulpn | grep 3306
so check. Maybe permissions in mysql are set wrong. You can set the host in mysql a user can connect from. When you created the user like this:CREATE USER 'newuser'@'localhost' IDENTIFIED BY 'password';
it could be the problem. – Henrik Pingel Reinstate Monica Nov 11 '15 at 21:20mysql -uuser -p
. And sure, there could be an issue with the user permissions but I can't even connect to port 3306. I can dotelnet servername.com 22
,telnet servername.com 80
andtelnet servername.com 443
just fine. Buttelnet servername.com 3306
times out. And I'm not running a telnet server on those ports - it's just an easy way to see if a port is at least open and port 3306 isn't. – neubert Nov 11 '15 at 21:46iptables | grep
output, if those are preceded by a DROP they won't be reached. Use` iptables -L -vn` to show counters to show what rules are hit how often. – wurtel Nov 12 '15 at 14:51