- MySql, . SQL
1). Here you need two computers if you do it offline for testing, and the first PC will be your MASTER, and the other will act as SLAVE.
2). Check the IP address of your computers.
3). I run it on Localhost with these two next computers
Machine-1: - 192.168.1.20
Machine-2: - 192.168.1.21
and then open Mysql and start typing these commands on both machines as follows
IP-Address e.g. = 192.168.1.20
CREATE USER 'server1'@'%' IDENTIFIED BY '12345';
GRANT REPLICATION SLAVE ON *.* TO 'server1'@'%' IDENTIFIED BY '12345';
FLUSH TABLES WITH READ LOCK;
SHOW MASTER STATUS;
UNLOCK TABLES;
IP-Address e.g. = 192.168.1.21
STOP SLAVE;
RESET SLAVE;
CHANGE MASTER TO
MASTER_HOST = '192.168.1.20',
MASTER_USER = 'server1',
MASTER_PASSWORD = '12345',
MASTER_PORT = 3306,
MASTER_LOG_FILE = 'Type_your_log_file_name',
MASTER_LOG_POS = TYPE_YOUR_LOG_POSITION_HERE,
MASTER_CONNECT_RETRY = 10,
START SLAVE;
SHOW SLAVE STATUS \G;
source
share