在从库使用show slave status\G; 查看同步状态,若出现一下问题:
Could not execute Update_rows event on table ecsp.ecsp_app2_heads;
Could not execute Delete_rows event on table ecsp.ecsp_zsxyzh_compare;
一般是主库的表进行修改,删除,但从库并没有对应的表,到导致的错误:
方法一:
同步主库数据到从库,然后再开启主从同步
方法二:
使用跳过命令:
stop slave;
set global sql_salve_skip_count=1;
start slave;
reset slave all 命令
清除连接从库与主库的连接信息,使用后可以用 show slave status\G 命令查看从库连接,
show master status 命令
查看主库当前记录的bin文件,
从库连接主库命令
change master to master_host='主库IP',master_port=端口,master_user='root',master_password='密码',master_log_file='日志文件',master_log_pos=154;