Configure the Master DB

sudo /etc/mysql/my.conf
bind-address            = 12.34.56.789
log_bin                 = /var/log/mysql/mysql-bin.log
server-id               = 1
binlog_do_db            = urdb
sudo service mysql restart
mysql -u root -p
GRANT REPLICATION SLAVE ON *.* TO ‘slave_user’@’%’ IDENTIFIED BY ‘password’;
FLUSH PRIVILEGES;
USE newdatabase;
FLUSH TABLES WITH READ LOCK;
SHOW MASTER STATUS;
mysqldump -u root -p –opt newdatabase > newdatabase.sql
UNLOCK TABLES;
QUIT;

Configure the Slave Database

CREATE DATABASE newdatabase;
EXIT;
mysql -u root -p newdatabase < /path/to/newdatabase.sql
sudo nano /etc/mysql/my.cnf
server-id               = 2
relay-log               = /var/log/mysql/mysql-relay-bin.log
log_bin                 = /var/log/mysql/mysql-bin.log
binlog_do_db            = db
sudo service mysql restart
CHANGE MASTER TO MASTER_HOST=’12.34.56.789′,MASTER_USER=’slave_user’, MASTER_PASSWORD=’password’, MASTER_LOG_FILE=’mysql-bin.000001′, MASTER_LOG_POS=  107;
START SLAVE;
SHOW SLAVE STATUS;