-
-
Save olublessed/a5fbf809418cbabb807fdc2f7a797ff0 to your computer and use it in GitHub Desktop.
MySQL Replication: 'Duplicate entry for PRIMARY key'
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
while [ 1 ]; do if ['mysql -uroot -ppassword -e"show slave status \G;" | grep "Duplicate entry" | wc -l' -eq 2 ] ; then mysql -uroot -ppassword -e"stop slave; set global sql_slave_skip_counter=1; start slave;"; fi; sleep 1; mysql -uroot -ppassword -e"show slave status\G"; done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment