Use pt-table-sync to setup a new MySQL DB

Posted by Generation D Systems on Server Fault See other posts from Server Fault or by Generation D Systems
Published on 2014-08-24T03:37:29Z Indexed on 2014/08/24 4:22 UTC
Read the original article Hit count: 490

Filed under:
|
|

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?

© Server Fault or respective owner

Related posts about mysql

Related posts about replication