vi /etc/f //加入下面的配置
server-id=116relay-log-index=slave-relay-bin.indexrelay-log=slave-relay-bin
read_only=1
change master to master_host='192.168.0.110', master_user='slave', master_password='12345678', master_log_file='mysql-bin.000003', master_log_pos=767; //连接主服务器指定binlog日志和位置
start slave; //启动从服务
show slave status \G; //查看从服务器的状态
如果说有问题
可以先查看master的状态
show master status;
stopslave;
change master to master_host='192.168.0.110', master_user='slave', master_password='12345678', master_log_file='mysql-bin.000003', master_log_pos=767; //把这个master_log_file的名字改下master_log_pos位置下
start slave;