https://www.cnblogs.com/crazymagic/articles/7683928.html
http://blog.csdn.net/xlgen157387/article/details/51331244/
http://blog.csdn.net/heng_ji/article/details/51013710
当系统在运行过程中的时候,想做主从,先把主库完全备份,然后还原到从上。
然后执行如下操作
stop slave;
change master to master_host='192.168.x.xxx', master_user='xxxx',
master_password='xxxx',master_log_file='mysql-bin.000001',
master_log_pos=12312313;
start slave;
如果slave sql running 还是no
看一下报错日志
SHOW GLOBAL VARIABLES LIKE '%log%'
查看其中的
log_error 参数对应的错误日志路径
参考:https://www.cnblogs.com/Vanos-lcp/p/5543044.html
找到错误的记录,可能在你执行这些操作的时候同时有写入操作了,所以导致的。
停掉哪些可能每秒都在操作的动作。
然后再执行上面的语句,应该就可以了。 不行的话,试试下面的语句
当然最好是停止所有的应用是最好的。
stop slave;
set GLOBAL SQL_SLAVE_SKIP_COUNTER=1;
start slave;show slave status;