I like having network disabled on mysql, but now I need to replicate one table across two servers. That is, the table will be updated on one server and then I need a copy of that table to be maintained on another server. Is there a reasonable way to do this without enabling network access?
My initial idea was to use socat to create a pipe using something like:
socat "UNIX-LISTEN:/tmp/mysql.sock.server2,reuseaddr,fork" \
EXEC:'ssh server2.mydomain.com \
socat STDIO UNIX-CONNECT\:/tmp/mysql.sock'
and then let the slave communicate to the master via that socket. So far that works great for starting a command-line client but I'm not sure how to proceed, if that approach is even possible.
If something like this doesn't work, then I'll probably just be doing the replication manually using a shell script that runs periodically to sync the tables over ssh.
127.0.0.1? Yeah, i'm familiar with that. Probably just going to go with a dump over ssh solution - the db is small. – Thom Blake Mar 8 '12 at 18:37