Error Duplicate entry for key on query

mysql-logo-imageOn checking MySQL/MariaDB slave status we can see the following error:

There are a few ways how to treat such kind of errors.

Repair MySQL table

If repairement completed successfully check replication status again.

If you want to repair all tables in your database run the following script:

Ignore MySQL error 1062

This is not recommended way but can back you in business quickly:

This command will make MySQL/MariaDB to ignore error 1062 one time.

If you have such kind of errors regularily you should drill down to a root cause and fix your application.

If this error does not break anything you can ignore it constantly. In /etc/my.cnf on Slave server:
slave-skip-errors = 1062
You can also ignore problematic tables.
In /etc/my.cnf on Slave server:

Ignore all tables from a database ‘pets‘.
You can specify multiple directives:

Also ignore all tables starting from dogs_ in database ‘breed

Want me to do this for you? Drop me a line: itgalaxyzzz {at} gmail [dot] com