To set new replica on MySQL seems to be quite simple task.
You just follow instructions described for example here: How to manually set MySQL replication

BUT !!!
There is one big “gotcha” in MySQL replication especially in STATEMENTS format which is not so widely emphasized – it is about logging (or not logging) statements into bin log. Which means if statement is not logged in bin log it is not send to replicas.

And it is a real problem and we had this issue in past – we simply used replication settings done by someone in the past. And later we discovered differences in data between master and replicas.

General problem is that “binlog-do-db” setting depends on using “USE database_name” command. Does not work for cross-database references.

If you wildly use commands with cross-database references you MUST:

  • either stop using binlog-do-db and replicate-do-db and similar settings at all
  • or if you really need to limit replication then remove binlog-do-db and similar on master and set “replicate-wild-do-table” parameter or similar on replica (but NOT replicate-do-db ! – has the same limitations as binlog-do-db)

Useful links: