业务需要将亚马逊rds同步到本地,实现增量备份,测试过程中遇到的几点问题,记录一下
失败原因1:
源库binlog没有开启,增量迁移无法拉取事务日志
输入查询命令,确认log_bin=on
show variables like "%bin%";
解决方案调用命令
show global variables like 'log_bin';
确认log_bin=on。在源实例,更改my.cnf,设置log_bin,并重启MySQL后重新进行预检查
失败原因2:
源库binlog format 不是row
解决方案:在源库执行:
set global binlog_format=ROW
后重新进行预检查。建议重启MySQL,否则连接中的session可能以非ROW模式继续写入
失败原因3:
如果源库是Mysql5.6,binlog_row_image必须为FULL模式
解决方案:在源库中,执行
set global binlog_row_image=FULL
命令,设置binlog_row_image为FULL
失败原因4:
目标库存在跟待迁移对象同名的结构对象(库重复了,可以暂时忽略)
gwms.nr_stock_freeze--->nr_stock_freeze.nr_stock_freeze
解决方案:(三选一)
(1)修改待迁移对象在目标库的名称,使用迁移列表选择的重命名功能
(2)删除或重命名目标库的对象
(3)暂时不迁移该同名对象
删除触发器!!!!!
SELECT * FROM information_schema.`TRIGGERS`
drop trigger triggers_name
drop trigger tri_stock;
Today, I went to the beachfront with my children. I found a sea shell and
gave it to my 4 year old daughter and said "You can hear the ocean if you put this to your ear." She placed
the shell to her ear and screamed. There was a
hermit crab inside and it pinched her ear. She never wants to go back!
LoL I know this is totally off topic but I had to tell someone!