Use pt-table-sync to setup a new MySQL DB
- by Generation D Systems
I have 2 hosts (A and B). B contains a MySQL server with a database called mydb, and A contains a MySQL server with nothing (fresh install). I want to replicate the entire mydb from B to A, by running a script on A (I do not have shell access to B).
Can I run this on A:
pt-table-sync --execute h=b.mydomain.com,D=mydb h=a.mydomain.com
I've read the docs but don't get a 100% comfort feeling (perhaps because of all the warnings about damaging your data if you don't know what you're doing). Will this work?
as well, is h=a.mydomin.com necessary? (Will it route all traffic back in/out the local NIC?) can I use localhost or nothing at all?