I think you could accomplish this with ssh, actually ...
eg: once mysqld is off on your local machine, set up a script that just maintains a command like:
Code:
#!/bin/bash
while /bin/true
do
ssh -g -L 3306:databaseserver:3306 someuser@localhost
sleep 1
done
and set up an rsa or dsa key for someuser on localhost for passwordless logins.
This is sort of the quick-and-dirty hack way to do it, but it'd work. I'm fairly sure you can accomplish something similar with iptables nat rules, but I'm having trouble crafting the exact rules you'd need, offhand.
(this is eerily similar to my post
here on a similar subject ... when you have a good enough hammer, everything really is a nail
)