从开启GTID的库中导出数据到未开启GTID的库中,需要注意,在导出的文件中去掉相应的gtid内容,否则导入时会报错如下:
ERROR 1839 (HY000) at line 24 in file: '/root/db_hdf_bqjfl_xxxx_xx_xx.sql': @@GLOBAL.GTID_PURGED can only be set when @@GLOBAL.GTID_MODE = ON.
1、mysqldump导出数据时候需要加参数 --set-gtid-purged=OFF
ERROR 1781 (HY000): @@SESSION.GTID_NEXT cannot be set to UUID:NUMBER when @@GLOBAL.GTID_MODE = OFF.
2.导出的增量日志需要去掉GTID
sed -i 's/SET @@SESSION.GTID_NEXT/#SET @@SESSION.GTID_NEXT/g' mysql-bin.000547_binlog.sql