How can I create a domain mysql1.domain.com in Windows Server 2008 R2 and set the server to connect the local MySQL server on port 3306 when someone uses that domain in his application? How about then if I want that only the users in the same network (connected via VPN) can access an another MySQL server by typing in mysql2.domain.com?
closed as not a real question by Tom O'Connor, mgorven, Tim Brigham, Wesley, Dave M Jul 8 '12 at 21:23
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.
Every network-enabled service needs a port. Even HTTP/HTTPS does, but the browser typically hides :80 and :443 from the user's view since they're nice like that. It doesn't change the fact that they're still used. You can't just have a network-enabled service like MySQL not use a port.
I think you may be getting confused, because you are able to resolve web sites without specifying a port. In reality, you do specify a port, but your browser appends :80 or :443 as needed. If you had a default port that all traffic was coming in on, you could put a reverse proxy in the middle and redirect traffic to a different port from that, but there's no native baked-in way to just say "meh, I don't want to use ports across the Internet." It's just the way that TCP/IP works.
Edit: Buried in your misguided comments that were deleted by a moderator, you said this:
That is completely different than your original question, but it is answerable.
On Windows, there's no native tool to do this. You'll need to put a reverse proxy between exa.mp.le and your clients. Then, have a rule on that proxy that forwards that traffic to a different port of your choosing (iptables and pf can do this, as can mod_proxy and many other modules).
If the server were running Linux, you could just use a simple iptables rule for this. Unfortunately, though much better in 2008 and 2008 R2, Windows Firewall still hasn't reached feature parity with iptables.