Software

Cannot update GTID_PURGED with the Group Replication plugin running

今天將 GR 的資料做 mysqldump 的時候發生了這樣子的警告訊息,然後在匯入到新環境的時候就發生了錯誤

Warning: A partial dump from a server that has GTIDs will by default include the GTIDs of all transactions, even those that changed suppressed parts of the database. If you don't want to restore GTIDs, pass --set-gtid-purged=OFF. To make a complete dump, pass --all-databases --triggers --routines --events.

主要是因為 MGR 狀態的時候會啟動 GTID 所以在匯入到新的資料庫的時候要重新產生 GTID ,所以做 mysqldump 的時候必須加上 --set-gtid-purged=OFF

但如果已經匯出了話怎麼辦呢??官方有一個說法就是進去 dump file 裡面將裡面將 @@GLOBAL.gtid_purged 這段移除掉就可以了

我的理解內容是這個動作會先清除掉 GTID 但是在匯入的環境底下並沒有 GTID 跟對應的 binlog ,所以在匯入的時候就發生了錯誤,因為根本就找不到所以就發生了錯誤