Master:

  • Backup the desired databases
  • Create a replication user
  • Modify the /etc/mysql/my.cnf:
server-id=[MASTER SERVER ID]
log_bin=mysql-bin
log_error=mysql-bin.err
  • Restart the MySQL server

Slave:

  • Import the master's database
  • Connect to the master using server-id = [MASTER SERVER ID]
  • Restart MySQL
FLUSH TABLES WITH READ LOCK;
SET GLOBAL read_only = ON;