// mysql · logging & diagnostics

innodb_print_all_deadlocks

Write every InnoDB deadlock to the error log.

Default
OFF
Range
ON, OFF
Restart needed
No
Default checked on
MySQL 8.4 LTS

What it does

SHOW ENGINE INNODB STATUS keeps only the latest deadlock. This records each one with both transactions and their locks.

Default value

OFF. OFF (MySQL 8.4).

Check the current value

SHOW GLOBAL VARIABLES LIKE 'innodb_print_all_deadlocks';

SELECT VARIABLE_NAME, VARIABLE_SOURCE, MIN_VALUE, MAX_VALUE, SET_TIME
FROM performance_schema.variables_info
WHERE VARIABLE_NAME = 'innodb_print_all_deadlocks';

Change it

SET GLOBAL innodb_print_all_deadlocks = ON;    -- until the next restart
SET PERSIST innodb_print_all_deadlocks = ON;   -- now and after restarts

No restart. SET GLOBAL or SET PERSIST takes effect immediately; SET PERSIST also writes mysqld-auto.cnf so the value survives restarts.

When to change it

When the application reports deadlocks (error 1213) and you need history to find the pattern.

What can go wrong

The error log grows on systems that deadlock often.

Questions about innodb_print_all_deadlocks

What is the default value of innodb_print_all_deadlocks in MySQL?

OFF. OFF (MySQL 8.4).

Does changing innodb_print_all_deadlocks require a restart?

No. No restart. SET GLOBAL or SET PERSIST takes effect immediately; SET PERSIST also writes mysqld-auto.cnf so the value survives restarts.

When should I change innodb_print_all_deadlocks?

When the application reports deadlocks (error 1213) and you need history to find the pattern.

Back to all MySQL settings, or check the MySQL manual for every option.

// one client for every engine

Check innodb_print_all_deadlocks on your own server

SQLly runs the query above against MySQL and the other engines in this reference, from one desktop app on macOS, Windows and Linux.