# innodb_status_file

--innodb-status-file

Property Value
Command-Line Format –innodb-status-file[={OFF ON}]
Type Boolean
Default Value OFF

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.

For related information, see Section 14.18.2, “Enabling InnoDB Monitors”.

#### 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.

# innodb_status_output_locks

innodb_status_output_locks=off

innodb_status_output_locks=on, innodb_show_verbose_locks=0

innodb_status_output_locks=on, innodb_show_verbose_locks=1

# innodb_show_verbose_locks

percona分支参数

• variable innodb_show_verbose_locks

Command Line:YesConfig File:YesScope:GlobalDynamic:YesVariable Type:ULONGDefault Value:0Range:0 - 1

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.

innodb_show_verbose_locks=1, innodb_print_all_deadlocks=1, 则error log中死锁信息为

innodb_status_output=1,innodb_show_verbose_locks=0或1, innodb_status_output_locks=off

innodb_status_output=1,innodb_show_verbose_locks=0, innodb_status_output_locks=on

innodb_status_output=1,innodb_show_verbose_locks=1, innodb_status_output_locks=on