The --innodb-status-file startup option controls whether InnoDB creates a file named innodb_status.*pid* in the data directory and writes SHOW ENGINE INNODB STATUS output to it every 15 seconds, approximately.
The innodb_status.*pid* file is not created by default. To create it, start mysqld with the --innodb-status-file option. InnoDB removes the file when the server is shut down normally. If an abnormal shutdown occurs, the status file may have to be removed manually.
The --innodb-status-file option is intended for temporary use, as SHOW ENGINE INNODB STATUS output generation can affect performance, and the innodb_status.*pid* file can become quite large over time.
Directing Standard InnoDB Monitor Output to a Status File
Standard InnoDB Monitor output can be enabled and directed to a status file by specifying the --innodb-status-file option at startup. When this option is used, InnoDB creates a file named innodb_status.*pid* in the data directory and writes output to it every 15 seconds, approximately.
InnoDB removes the status file when the server is shut down normally. If an abnormal shutdown occurs, the status file may have to be removed manually.
The --innodb-status-file option is intended for temporary use, as output generation can affect performance, and the innodb_status.*pid* file can become quite large over time.
Specifies to show records locked in SHOW ENGINE INNODB STATUS. The default is 0, which means only the higher-level information about the lock (which table and index is locked, etc.) is printed. If set to 1, then traditional InnoDB behavior is enabled: the records that are locked are dumped to the output.
TRANSACTION 5127, ACTIVE 5 sec starting index read mysql tables in use 1, locked 1 LOCK WAIT 2 lock struct(s), heap size 1136, 1 row lock(s) MySQL thread id 3, OS thread handle 140073055278848, query id 26 localhost root statistics select u_c from t8 where d_id='1'and b_id='1'and is_dropped=0for update 2020-05-15T10:24:29.703987+08:004 [Note] InnoDB: *** (1) WAITING FOR THIS LOCK TO BE GRANTED:
RECORD LOCKS space id 128 page no 4 n bits 80 index DealerAndBrokerAndDropped of table `fanboshi`.`t8` trx id 5127 lock_mode X locks rec but not gap waiting 2020-05-15T10:24:29.704003+08:004 [Note] InnoDB: *** (2) TRANSACTION:
TRANSACTION 5126, ACTIVE 9 sec starting index read mysql tables in use 1, locked 1 4 lock struct(s), heap size 1136, 3 row lock(s) MySQL thread id 4, OS thread handle 140073055008512, query id 27 localhost root updating update t8 set u_c='b' where d_id='1'and b_id='1' 2020-05-15T10:24:29.704016+08:004 [Note] InnoDB: *** (2) HOLDS THE LOCK(S):
RECORD LOCKS space id 128 page no 4 n bits 80 index DealerAndBrokerAndDropped of table `fanboshi`.`t8` trx id 5126 lock_mode X locks rec but not gap 2020-05-15T10:24:29.704025+08:004 [Note] InnoDB: *** (2) WAITING FOR THIS LOCK TO BE GRANTED:
RECORD LOCKS space id 128 page no 4 n bits 80 index DealerAndBrokerAndDropped of table `fanboshi`.`t8` trx id 5126 lock_mode X waiting 2020-05-15T10:24:29.704034+08:004 [Note] InnoDB: *** WE ROLL BACK TRANSACTION (1)
TRANSACTION 5130, ACTIVE 6 sec starting index read mysql tables in use 1, locked 1 LOCK WAIT 2 lock struct(s), heap size 1136, 1 row lock(s) MySQL thread id 3, OS thread handle 140073055278848, query id 38 localhost root statistics select u_c from t8 where d_id='1'and b_id='1'and is_dropped=0for update 2020-05-15T10:54:23.575945+08:004 [Note] InnoDB: *** (1) WAITING FOR THIS LOCK TO BE GRANTED:
RECORD LOCKS space id 128 page no 4 n bits 80 index DealerAndBrokerAndDropped of table `fanboshi`.`t8` trx id 5130 lock_mode X locks rec but not gap waiting Record lock, heap no 2 PHYSICAL RECORD: n_fields 4; compact format; info bits 0 0: len 1; hex 31; asc 1;; 1: len 1; hex 31; asc 1;; 2: len 1; hex 80; asc ;; 3: len 8; hex 8000000000000001; asc ;;
TRANSACTION 5129, ACTIVE 8 sec starting index read mysql tables in use 1, locked 1 4 lock struct(s), heap size 1136, 3 row lock(s) MySQL thread id 4, OS thread handle 140073055008512, query id 39 localhost root updating update t8 set u_c='b' where d_id='1'and b_id='1' 2020-05-15T10:54:23.576798+08:004 [Note] InnoDB: *** (2) HOLDS THE LOCK(S):
RECORD LOCKS space id 128 page no 4 n bits 80 index DealerAndBrokerAndDropped of table `fanboshi`.`t8` trx id 5129 lock_mode X locks rec but not gap Record lock, heap no 2 PHYSICAL RECORD: n_fields 4; compact format; info bits 0 0: len 1; hex 31; asc 1;; 1: len 1; hex 31; asc 1;; 2: len 1; hex 80; asc ;; 3: len 8; hex 8000000000000001; asc ;;
2020-05-15T10:54:23.576847+08:004 [Note] InnoDB: *** (2) WAITING FOR THIS LOCK TO BE GRANTED:
RECORD LOCKS space id 128 page no 4 n bits 80 index DealerAndBrokerAndDropped of table `fanboshi`.`t8` trx id 5129 lock_mode X waiting Record lock, heap no 2 PHYSICAL RECORD: n_fields 4; compact format; info bits 0 0: len 1; hex 31; asc 1;; 1: len 1; hex 31; asc 1;; 2: len 1; hex 80; asc ;; 3: len 8; hex 8000000000000001; asc ;;
2020-05-15T10:54:23.576896+08:004 [Note] InnoDB: *** WE ROLL BACK TRANSACTION (1)
status_filev0v1off ------------ TRANSACTIONS ------------ Trxidcounter5640 Purgedonefortrx'sn:o<0undon:o<0 state:runningbutidle Historylistlength0 LIST OF TRANSACTIONS FOR EACH SESSION: ---TRANSACTION421976761961816,notstarted 0lockstruct(s),heapsize1136,0rowlock(s) ---TRANSACTION5639,ACTIVE301sec 3lockstruct(s),heapsize1136,2rowlock(s) MySQLthreadid3,OSthreadhandle140502089639680,queryid23localhostroot
status_filev0on ------------ TRANSACTIONS ------------ Trxidcounter5640 Purgedonefortrx'sn:o<0undon:o<0 state:runningbutidle Historylistlength0 LIST OF TRANSACTIONS FOR EACH SESSION: ---TRANSACTION421976761961816,notstarted 0lockstruct(s),heapsize1136,0rowlock(s) ---TRANSACTION5639,ACTIVE901sec 3lockstruct(s),heapsize1136,2rowlock(s) MySQLthreadid3,OSthreadhandle140502089639680,queryid23localhostroot TABLELOCKtable`fanboshi`.`t8`trxid5639 lockmodeIX RECORDLOCKSspaceid128pageno4nbits80indexDealerAndBrokerAndDroppedoftable`fanboshi`.`t8`trxid5639 lock_modeXlocksrecbutnotgap RECORDLOCKSspaceid128pageno3nbits80indexPRIMARYoftable`fanboshi`.`t8`trxid5639 lock_modeXlocksrecbutnotgap
status_filev1on ------------ TRANSACTIONS ------------ Trxidcounter5640 Purgedonefortrx'sn:o<0undon:o<0 state:runningbutidle Historylistlength0 LIST OF TRANSACTIONS FOR EACH SESSION: ---TRANSACTION421976761961816,notstarted 0lockstruct(s),heapsize1136,0rowlock(s) ---TRANSACTION5639,ACTIVE561sec 3lockstruct(s),heapsize1136,2rowlock(s) MySQLthreadid3,OSthreadhandle140502089639680,queryid23localhostroot TABLELOCKtable`fanboshi`.`t8`trxid5639 lockmodeIX RECORDLOCKSspaceid128pageno4nbits80indexDealerAndBrokerAndDroppedoftable`fanboshi`.`t8`trxid5639 lock_modeXlocksrecbutnotgap Recordlock,heap no 2 PHYSICAL RECORD:n_fields4;compactformat;infobits0 0:len1;hex31;asc1;; 1:len1;hex31;asc1;; 2:len1;hex80;asc;; 3:len8;hex8000000000000001;asc;;