You can use socat for this. There is a Windows port based on Cygwin.
The examples section has this
socat -d -d -lmlocal2 \
TCP4-LISTEN:80,bind=myaddr1,su=nobody,fork,range=10.0.0.0/8,reuseaddr \
TCP4:www.domain.org:80,bind=myaddr2
TCP port forwarder, each side bound to another local IP address
(bind). This example handles an almost arbitrary number of parallel or
consecutive connections by fork'ing a new process after each accept()
. It provides a little security by su'ing to user nobody after
forking; it only permits connections from the private 10 network
(range); due to reuseaddr, it allows immediate restart after master
process's termination, even if some child sockets are not completely
shut down. With -lmlocal2, socat logs to stderr until successfully
reaching the accept loop. Further logging is directed to syslog with
facility local2.
Although this example is for port 80 (HTTP) you can use socat to create a bidirectional relay for almost any protocol.
You'll notice it shows it's Linux/Unix origins. I don't know how well The Windows port works on Windows or whether some of the options are unsuitable for Windows. I'd give it a try.
For a production system I'd try
- getting MySQL to listen on multiple port numbers (not currently possible)
- use port translation in a router?
- Using socat on a Linux box to relay with port translation. And TEST TO DESTRUCTION.
(Ick)
Why not change the port used by MySQL? Note that your network admins might start hating you if you do this, because they probably have a good reason for this policy.
– Daniel Beck – 2012-05-17T15:17:24.467I would do that, but if I did do that I'd have to change all the connection info for websites, programs, etc... – scjosh – 2012-05-17T15:25:15.823
If you have a Linux system somewhere outside the restricted network, look into SSH tunneling. – Daniel Beck – 2012-05-17T15:28:42.770