title: Last_SQL_Error: Could not execute Delete_rows event on table Replication error?
body: <p>I am in the process of migrating an on prem mysql database to amazon aurora and used the <a href="https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/AuroraMySQL.Migrating.ExtMySQL.html" rel="nofollow noreferrer">official AWS documentation</a>. Per the Docs these are the steps that i have followed so far:-</p>
  <ol>
  <li>Set up Percona Xtrabackup.</li>
  <li>Took a backup and moved the data to S3.</li>
  <li>Went to RDS Dashboard and restored the database from S3.</li>
  <li>The Database is up and running successfully.</li>
  </ol>
  <p>Now i am in the process of setting up <strong>binlog</strong> replication where my Aurora instance will be the replica while my on prem mysql is the master. To set up replication, i followed the steps as laid down in the official docs:-</p>
  <ol>
  <li><p>On my master, created a user 'replica-aurora' and provided the necessary permissions using <code>GRANT REPLICATION SLAVE ON *.* TO 'replica-aurora'@'%' IDENTIFIED BY 'my-secret-password';</code></p>
  </li>
  <li><p>Ran Show master status on my master which in on prem.</p>
  <pre><code> File: mysql-bin.004762
    Position: 68093017
    Binlog_Do_DB: 
    Binlog_Ignore_DB: 
    Executed_Gtid_Set: 
    1 row in set (0.00 sec)
  </code></pre>
  </li>
  <li><p>Connected to my aurora instance and ran the following command :-</p>
  <pre><code>CALL mysql.rds_set_external_master ('Ip-of-master', 3306, 'replica-aurora',  'password', 'mysql-bin.004762', 68093017, 0);
  </code></pre>
  </li>
  <li><p>Ran <code>CALL mysql.rds_start_replication;</code></p>
  </li>
  <li><p>When i check the <code>show slave Status\G</code>. I keep running into the following error message :-</p>
  <pre><code>Slave_IO_State: Waiting for master to send event
                Master_Host: Master-IP
                Master_User: replica-aurora
                Master_Port: 3306
              Connect_Retry: 60
            Master_Log_File: mysql-bin.004762
        Read_Master_Log_Pos: 71341857
             Relay_Log_File: relaylog.000002
              Relay_Log_Pos: 195715
      Relay_Master_Log_File: mysql-bin.004762
           Slave_IO_Running: Yes
          Slave_SQL_Running: No
            Replicate_Do_DB: 
        Replicate_Ignore_DB: 
         Replicate_Do_Table: 
     Replicate_Ignore_Table: mysql.rds_replication_status,mysql.rds_monitor,mysql.rds_sysinfo,mysql.rds_configuration,mysql.rds_history
    Replicate_Wild_Do_Table: 
    Replicate_Wild_Ignore_Table: 
                 Last_Errno: 1032
                 Last_Error: Could not execute Delete_rows event on table db.feed; Can't find record in 'feed', Error_code: 1032; handler error HA_ERR_KEY_NOT_FOUND; the event's master log mysql-bin.004762, end_log_pos 68293560
               Skip_Counter: 0
        Exec_Master_Log_Pos: 68288412
            Relay_Log_Space: 3249360
            Until_Condition: None
             Until_Log_File: 
              Until_Log_Pos: 0
         Master_SSL_Allowed: No
         Master_SSL_CA_File: 
         Master_SSL_CA_Path: 
            Master_SSL_Cert: 
          Master_SSL_Cipher: 
             Master_SSL_Key: 
      Seconds_Behind_Master: NULL
      Master_SSL_Verify_Server_Cert: No
              Last_IO_Errno: 0
              Last_IO_Error: 
             Last_SQL_Errno: 1032
             Last_SQL_Error: Could not execute Delete_rows event on table db.feed; Can't find record in 'feed', Error_code: 1032; handler error HA_ERR_KEY_NOT_FOUND; the event's master log mysql-bin.004762, end_log_pos 68293560
  </code></pre>
  </li>
  </ol>
  <p>I tried setting sql_slave_skip_counter=1 and ran into this :-</p>
  <p><code>mysql&gt; SET GLOBAL sql_slave_skip_counter = 1; ERROR 1227 (42000): Access denied; you need (at least one of) the SUPER privilege(s) for this operation</code></p>
  <p>I tried skipping the current position using <code>CALL mysql.rds_skip_repl_error;</code> but ran into the following :-</p>
  <pre><code>mysql&gt; CALL mysql.rds_skip_repl_error;
  +-------------------------------------+
  | Message                             |
  +-------------------------------------+
  | Statement in error has been skipped |
  +-------------------------------------+
  1 row in set (0.04 sec)
  
  +-----------------------------------------------------------------------------------+
  | Message                                                                           |
  +-----------------------------------------------------------------------------------+
  | Slave has encountered a new error. Please use SHOW SLAVE STATUS to see the error. |
  +-----------------------------------------------------------------------------------+
  1 row in set (2.14 sec)
  
  Query OK, 0 rows affected (2.14 sec)
  </code></pre>
  <p>which is essentially the same error message as posted above. ERROR 1032.</p>
  <p>Any one has ideas on how to fix this problem? I sure would appreciate that.</p>