HiveBrain v1.2.0
Get Started
← Back to all entries
patternsqlModerate

MySQL: What happens to the row when skip-errors=1062 is set

Submitted by: @import:stackexchange-dba··
0
Viewed 0 times
1062thewhatskipmysqlwhenhappenserrorsrowset

Problem

I found out that I can set skip-errors=1062 in the my.cnf but I need to know what happens to the row when the error happens. Does it get silently dropped? Or is that config option the equivalent to STOP SLAVE;SQL_SLAVE_SKIP_COUNTER=1; START SLAVE;

Solution

Yes, it is equivalent, provided the slave error you are skipping is 1062 (Duplicate Key)

It would have to appear in the [mysqld] section of my.cnf like this

[mysqld]
slave-skip-errors=1062


All other error numbers will stop the SQL thread and would require

STOP SLAVE;
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1;
START SLAVE;


to have replication conitnue

If you have multiple error numbers to skip, it should be a comma-delimited list of error numbers

[mysqld]
slave-skip-errors=1062,1053


For more information, please read the MySQL Documentation on it.

You asked


Does it get silently dropped?

Yes it does. Just remember that any non-key columns that were supposed to change will not change.

Code Snippets

[mysqld]
slave-skip-errors=1062
STOP SLAVE;
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1;
START SLAVE;
[mysqld]
slave-skip-errors=1062,1053

Context

StackExchange Database Administrators Q#65690, answer score: 11

Revisions (0)

No revisions yet.