Skip to content

Instantly share code, notes, and snippets.

@jamesattard
Last active August 29, 2015 14:14
Show Gist options
  • Select an option

  • Save jamesattard/1eda1e43f0111f46449c to your computer and use it in GitHub Desktop.

Select an option

Save jamesattard/1eda1e43f0111f46449c to your computer and use it in GitHub Desktop.
MySQL Replication Skip "Duplicate Error"
#!/bin/bash
while [ `mysql -e "show slave status" | grep -c "Error_code: 1062"` -ge 1 ]; do
`mysql -e "SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1; START SLAVE"`
echo -n "."; sleep 1
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment