Skip to content

Instantly share code, notes, and snippets.

@victorpendleton
Last active October 4, 2017 15:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save victorpendleton/8472fdbff81c42aeb365133bb6e462ca to your computer and use it in GitHub Desktop.
Save victorpendleton/8472fdbff81c42aeb365133bb6e462ca to your computer and use it in GitHub Desktop.
How to skip MySQL replication errors using GTIDs
SHOW SLAVE STATUS\G
-- Grab Primary Host from `Retrieved_Gtid_Set`
-- Retrieved_Gtid_Set: PRIMARY_GUID:1234567
-- Find what value has been executed from primary from Executed_Gtid_Set
-- Executed_Gtid_Set: PRIMARY_GUID:123455
STOP SLAVE;
-- Set the gtid to next value
SET GTID_NEXT ='PRIMARY_GUID:123456';
begin; commit;
set gtid_next = 'AUTOMATIC';
START SLAVE;
-- Check for any additional errors
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment