主库:10.0.2.75;从库:10.0.2.230;

mysql> show slave status\G;

mysql主从断掉后,恢复

mysql> flush tables with read lock\G

mysql主从断掉后,恢复

mysql> show master status\G

mysql主从断掉后,恢复

mysql> change master to master_host='10.0.2.230', master_user='root', master_password='123456', master_log_file='mysql-bin.000005', master_log_pos=625;

###mater_log_file和master_log_pos的值是在从库上执行show master status的结果

mysql> start slave;

mysql主从断掉后,恢复

出现报错;处理;

mysql> reset slave;

mysql主从断掉后,恢复

重新配置;

mysql> change master to master_host='10.0.2.230', master_user='root', master_password='123456', master_log_file='mysql-bin.000005', master_log_pos=625;

mysql> start slave;

mysql主从断掉后,恢复

mysql> show slave status\G;

mysql主从断掉后,恢复

主库成功;开始配置从库;

mysql> flush tables with read lock\G

mysql> show master status\G

mysql主从断掉后,恢复

mysql> change master to master_host='10.0.2.75', master_user='root', master_password='123456', master_log_file='mysql-bin.000008', master_log_pos=639208;

###mater_log_file和master_log_pos的值是在主库上执行show master status的结果

mysql>  start slave;

mysql主从断掉后,恢复

mysql> reset slave;

mysql主从断掉后,恢复

mysql> change master to master_host='10.0.2.75', master_user='root', master_password='123456', master_log_file='mysql-bin.000008', master_log_pos=639208;

mysql>  start slave;

mysql主从断掉后,恢复

mysql> show slave status\G

mysql主从断掉后,恢复

mysql> UNLOCK TABLES;

mysql主从断掉后,恢复

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-09-22
  • 2021-10-16
  • 2022-12-23
  • 2021-11-19
  • 2022-12-23
猜你喜欢
  • 2021-06-11
  • 2021-11-30
  • 2021-10-18
  • 2022-01-24
  • 2022-01-15
  • 2021-11-11
  • 2021-09-25
相关资源
相似解决方案