根據bin log分析管理員被莫名刪除問題 ============== 根據bin log 分析管理員被莫名刪除問題 www.2cto.com # at 88572251 #120907 7:45:34 server id 1 end_log_pos 88572346 Query thread_id=32426664 exec_time=0 error_code=0 SET TIMESTAMP=1346975134/*!*/; DELETE FROM admin WHERE id=62 /*!*/; # at 88572346 #120907 7:45:34 server id 1 end_log_pos 88572418 Query thread_id=32426664 exec_time=0 error_code=0 SET TIMESTAMP=1346975134/*!*/; COMMIT /*!*/; # at 88572418 www.2cto.com #120907 7:45:34 server id 1 end_log_pos 88572489 Query thread_id=32426664 exec_time=0 error_code=0 SET TIMESTAMP=1346975134/*!*/; BEGIN /*!*/; # at 88572489 #120907 7:45:34 server id 1 end_log_pos 88572591 Query thread_id=32426664 exec_time=0 error_code=0 SET TIMESTAMP=1346975134/*!*/; DELETE FROM corp_db WHERE corp_id=62 /*!*/; # at 88572591 #120907 7:45:34 server id 1 end_log_pos 88572618 Xid = 132059217 COMMIT/*!*/; # at 88572618 #120907 7:45:34 server id 1 end_log_pos 88572689 Query thread_id=32426664 exec_time=0 error_code=0 SET TIMESTAMP=1346975134/*!*/; BEGIN /*!*/; 可以看到DELETE FROM admin WHERE id=62的上下文的sql操作,DELETE FROM corp_db WHERE corp_id=62 應該是刪除公司的時候引起了DELETE FROM admin 的代碼上的bug.