Metadata lock instrumentation uses the wait/lock/metadata/sql/mdl
instrument, which is enabled by default.
To control metadata lock instrumentation state at server startup, use lines like these in your my.cnf
file:
-
Enable:
[mysqld] performance-schema-instrument='wait/lock/metadata/sql/mdl=ON'
-
Disable:
[mysqld] performance-schema-instrument='wait/lock/metadata/sql/mdl=OFF'
To control metadata lock instrumentation state at runtime, update the setup_instruments table:
-
Enable:
UPDATE performance_schema.setup_instruments SET ENABLED = 'YES', TIMED = 'YES' WHERE NAME = 'wait/lock/metadata/sql/mdl';
-
Disable:
UPDATE performance_schema.setup_instruments SET ENABLED = 'NO', TIMED = 'NO' WHERE NAME = 'wait/lock/metadata/sql/mdl';