well, connecting to a mysql db through a reverse tunnel was easy.
on the host machine (in this case, my ircbot's vm) do something like:
$ ssh -nNT -R 3307:localhost:3306 remote@machine
now on the remote machine, i can test it is working by logging into mysql at that port:
$ mysql -h localhost -P 3307 -u root -p
all is well—or so i thought.
after configuring mysql to be a replication master in typical fashion, i enabled binlogs, set the binlog databases and gave it a server-id. something like this was added to the mysqld section of my my.cnf:
binlog-do-db = awesome
binlog-do-db = awesomest
binlog-ignore-db = mysql
binlog-ignore-db = test
server-id = 1
gave mysqld a restart.
then i added a replication user - note the @'%'
mysql> grant replication slave on *.* to 'repuser'@'%' identified by 'awesomepassword';
last thing to do was just make a dump of my databases. since they're small, i can do this.
then i check show slave status to make sure everything was okay
error connecting to master 'repuser@localhost:3307'
when i first set this up, i created my replication user as 'repuser'@'%'. normally that is fine, but in the default installation of mysql on arch linux, there are anonymous users. so logging in as 'repuser'@'localhost', it actually logged me in as ''@'localhost' instead of 'repl'. joy.
there are two ways to fix this:
create the user 'repuser'@'localhost'
remove anonymous users
i did both. all is well again in the land of nool.