同步故障Last_Errno: 1091

来源:互联网 发布:warframe 检测网络 编辑:程序博客网 时间:2024/06/06 00:17
从库状态:
  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'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.csdn.net/u010587433/article/details/46706099

  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。
疑问:
从库有相关外键,为什么删除报错呢?
0 0
原创粉丝点击