Slave replication stops with Last_SQL_Errno: 1032
Solution 1:
You can locate the sql clause code like /usr/bin/mysqlbinlog -v --start-position=142743807 --stop-position=147399325 /data/mysql/data/master-bin.000010 > temp.log
Then compare slave and master database difference according to temp.log on specific pos. Then update slave database.
Then skip that line with mysql -e "stop slave; SET GLOBAL SQL_SLAVE_SKIP_COUNTER = 1; start slave;";
Solution 2:
You can set the following in your slave's my.cnf: [mysqld] slave-skip-errors=1032
But as the documentation says: Do not use this option unless you fully understand why you are getting errors. One of the possible reason for this error could be due to “Slave_IO_Running: Yes” but “Slave_SQL_Running: No” that means your Slave IO process is running and retrieving data from Master but couldn’t execute due to Slave_SQL_Running process is stopped. A monitoring tool like Monyog can be used to proactively monitor the replication and alert you to the error or a lag or disconnection between the Master and Slave servers.
Solution 3:
For people who have this as a one off error, you can try skipping the item:
SET GLOBAL SQL_SLAVE_SKIP_COUNTER = 1;
START SLAVE;