暂无图片
暂无图片
暂无图片
暂无图片
暂无图片

MySQL主从同步故障

果酱桑 2021-05-19
321

MySQL主从同步故障-Slave_SQL_Running: No

首先停掉Slave服务:stop slave;

到主服务器上查看主机状态:
记录File和Position对应的值
进入master
mysql> show master status;
+----------------------+----------+--------------+------------------+
| File                | Position | Binlog_Do_DB | Binlog_Ignore_DB |
+----------------------+----------+--------------+------------------+
| mysql-bin.000006 | 282167 |              |                  | 
+----------------------+----------+--------------+------------------+
1 row in set (0.00 sec)

 

然后到slave服务器上执行手动同步:

change master to  master_host='10.1.1.144',  master_user='lb', master_password='ygW_2018',  master_port=3306,  master_log_file='mysql-bin.000006', master_log_pos=282167 ;

 

启动slave 服务: start slave;

查看主从状态:show slave status\G;显示如下则正常:

查看指定binlog文件的内容

show binlog events in 'mysql-bin.000001';

 

获取binlog文件列表

mysql> show binary logs;


文章转载自果酱桑,如果涉嫌侵权,请发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。

评论