主
log-bin=mysql-bin
server-id=1

grant replication slave on *.* to 'master'@'%' identified by 'master';
flush privileges;

show grants for master@'%';

show master status;    #查看binlog位置状态

show variables like '%timeout%';

从
relay-log=relay-bin
relay-log-info-file=relay-log.info
server-id=2

change master to master_host='127.0.0.1',master_port=3306,master_user='master',master_password='master',master_log_file='mysql-bin.000001',master_log_pos=2952;

start slave;

show slave status\G;