I can't access MYSQL on port 3306 from the internet on a linux box behind a router, What's missing?

Posted on 2006-04-21
Last Modified: 2008-01-09
I have a linux box running on with my sql working on it on port 3306 in my LAN,
I setup the router to forwars incoming calls on port 3306 to

I setup linux box with no FIREWALL to see if that fixed the problem but no luck. iptables -F .

I even tried with sftp using port 22 , port 80 web server and I get connection refused. What could be missing?

If I use the internal Network everything works great but not through the rourter port forwarding, which by the way works well because I have other ports on other server working perfectly.


Question by:henry007
    LVL 15

    Expert Comment

    On your box, try

    telnet 3306

    If you see something like this:

    Escape character is '^]'.

    This means mysql is running and bound to the correct IP address and you should troubleshoot your router. Depending on your router it may take a simple router reboot to flush router's ARP tables (hardware routers) or something like that from the command line (Linux routers). What kind of router do you use?

    Author Comment

    yes That's what I get, So I think there is a filter somewhere that only allows IPs starting with 192.1268.bla.bla.bla.  The Router is a belkin router. It's a piece of cake to configure, and as I said above it works on other OS's . What do you think ?
    LVL 15

    Expert Comment

    If you get "connection refused" for :21 and :80 connects I would take a look at /etc/hosts.deny & /etc/hosts.allow. Interesting though.

    Does your belin router have any admin testing tools (at least ping)?
    LVL 51

    Accepted Solution

      tcpdump -l -n port 3306
    on your linux box, then try to connect from internet, if you don't see anything then it's a router problem

    Author Comment

    I don't see anything. Nothing at al.  Mmmm the router is doing it job on other servers, I'll swap it just for the heck of it.

    Author Comment

    It's the router, I installed a linksys router and allow me to get through. I wonder why Belikin router won't budge, it works on windoze servers but not linux servers, Well I think I have to call the tech support in india and ask them why in the world is not forwarding to linux servers.

    Thanks to all

    Featured Post

    Find Ransomware Secrets With All-Source Analysis

    Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

    Join & Write a Comment

    This article will explain how to establish a SSH connection to Ubuntu through the firewall and using a different port other then 22. I have set up a Ubuntu virtual machine in Virtualbox and I am running a Windows 7 workstation. From the Ubuntu vi…
    I. Introduction There's an interesting discussion going on now in an Experts Exchange Group — Attachments with no extension ( This reminded me of questions tha…
    Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
    Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

    754 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    21 Experts available now in Live!

    Get 1:1 Help Now