Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MySQL replication from Linux to MySQL on Windows over SSH?

Tags:

linux

mysql

Is it possible to perform MySQL replication from the master database on Linux to a slave database running on Windows?

Also, an SSH connection must be established between the 2 servers; I'd like to be able to have a script on the slave Windows machine that would run periodically, establish the connection, wait for the replication to finish, and then drop the connection. So, pull from the client rather than push from the master. Is this possible/reasonable/difficult?

like image 634
tbone Avatar asked Oct 29 '25 15:10

tbone


1 Answers

(1) Yes, MySQL replication doesn't care about which OS its running on. There may be some corner cases with oddly named files, though. But that'll break the initial load, so you'll find out quick.

(2) You can use 'slave stop/start io_thread' to control the replication, so it runs when your SSH connection is up. You can check how far the replication has gotten (actually, only the IO thread matters, not the SQL thread) by using show master status & show slave status. You may also want to consider a "proper" VPN, such as OpenVPN (instead of ssh port forwarding).

like image 170
derobert Avatar answered Oct 31 '25 06:10

derobert



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!