mysql+for+debian_MySQL主从同步复制 for Debian 操作系统

4、常见问题

(1)(1)从库无法复制 Slave_SQL_Running 为No,Seconds_Behind_Master:Null

原因:1)有程序可能在从DB上进行写操作;

2)可能是从DB服务器重启,事物回滚造成;

解决:1)MySQL> slave stop;

mysql> set GLOBAL SQL_SLAVE_AKIP_COUNTER=1;

mysql> slave start;

2)手动同步先停止master的写操作

mysql>show master status;

+------------------+----------+--------------+------------------+

| File             | Position | Binlog_Do_DB | Binlog_Ignore_DB |

+------------------+----------+--------------+------------------+

| mysql-bin.000001 |       98 | testdb       | mysql            |

+------------------+----------+--------------+------------------+

然后到从库上手动同步

mysql> change master to

>master_host=’192.168.113.9’,

>master_user=’’repuser,

>master_password=’111111’,

>master_porte=’3306’,

>master_log_file=’ mysql-bin.000001’,

>master_log_pos=98;

mysql> slave start

(2)从库无法复制 Slave_IO_Running为No,Seconds_Behind_Master:Null

解决:1)测试与主DB网络3306端口的连通性

2)重启主DB MySQL---mysql> show master status;---找到对应的File字段内容

3)从DB上 mysql> stop slave;

mysql> change master to master_host='192.168.113.9',master_user='repuser',master_password='111111',master_port=3306,Master_Log_File='mysql-bin.000001',master_Log_Pos=98;

       mysql> start slave;0b1331709591d260c1c78e86d0c51c18.png

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值