同步故障Last_Errno: 1091

xishuai236發表於2015-06-29
從庫狀態:
  1. mysql> show slave status \G
  2. *************************** 1. row ***************************
  3.                Slave_IO_State: Waiting for master to send event
  4.                   Master_Host: 10.128.45.8
  5.                   Master_User: slave
  6.                   Master_Port: 3306
  7.                 Connect_Retry: 60
  8.               Master_Log_File: mysql-bin.000037
  9.           Read_Master_Log_Pos: 166473700
  10.                Relay_Log_File: mysqld-relay-bin.000096
  11.                 Relay_Log_Pos: 88687390
  12.         Relay_Master_Log_File: mysql-bin.000035
  13.              Slave_IO_Running: Yes
  14.             Slave_SQL_Running: No
  15.                    Last_Errno: 1091
  16.                    Last_Error: Error 'Can't DROP 'FK_Reference_15'; check that column/key exists' on query. Default database: 'storefeedback'. Query: 'ALTER TABLE `second_division` DROP FOREIGN KEY `FK_Reference_15`
錯誤日誌:
  1. 2015-06-26 23:57:39 2804 [ERROR] Slave SQL: Error 'Can't DROP 'FK_Reference_11'; check that column/key exists' on query. Default database: 'storefeedback'. Query: 'ALTER TABLE `division` DROP FOREIGN KEY `FK_Reference_11`', Error_code: 1091
  2. 2015-06-26 23:57:39 2804 [Warning] Slave: Can't DROP 'FK_Reference_11'; check that column/key exists Error_code: 1091
  3. 2015-06-26 23:57:39 2804 [ERROR] Error running query, slave SQL thread aborted. Fix the problem, and restart the slave SQL thread with "SLAVE START\". We stopped at log 'mysql-bin.000035' position 88680824
解決同Last_Errno: 1051 http://blog.itpub.net/26831783/viewspace-1709708/
  1. mysql> stop slave;
  2. Query OK, 0 rows affected (0.01 sec)
  3. mysql> set GLOBAL SQL_SLAVE_SKIP_COUNTER=1;
  4. Query OK, 0 rows affected (0.00 sec)
  5. mysql> start slave;
  6. Query OK, 0 rows affected (0.01 sec)
說明:start slave後,SQL_slave_skip_counter自動改回0。
疑問:
從庫有相關外來鍵,為什麼刪除報錯呢?

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/26831783/viewspace-1715774/,如需轉載,請註明出處,否則將追究法律責任。

相關文章