Last active
October 4, 2017 15:14
-
-
Save victorpendleton/8472fdbff81c42aeb365133bb6e462ca to your computer and use it in GitHub Desktop.
How to skip MySQL replication errors using GTIDs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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