I hope I got your attention with the title. The politically
correct term should be "how to redirect MySQL traffic on Linux",
but you probably wouldn't have noticed.
The scenario is this. You want to switch servers without need for
the clients to change connection parameters.
Why would you want to do this? Some reasons:
- You want to test a new server version, which you installed to listen to port 13306, and you want to do it without modifying the applications parameters;
- You ant to use MySQL Proxy on port 4040 to log the traffic for a while without restarting the server, in order to debug an inexplicable problem;
Whatever the reason, you can do it.
Here is how you can proceed on Linux.
Set a iptables rule to redirect port 3306 to port 13306 or to
port 4040:
sudo …[Read more]