March 14, 2017

How to get Active Transactions and Locks from MySQL

To get a list of active transactions and locks that are currently executing against our target database

MySQL captures transaction and lock information in the INNODB_TRX, INNODB_LOCKS, and INNODB_LOCK_WAITS INFORMATION_SCHEMA tables.
  • INNODB_TRX provides us with information on the currently executing transactions.
  • INNODB_LOCKS gives us information on current lock.
  • INNODB_LOCK_WAITS provides information on who is actually waiting for locks. 
The query below enables one to see active locks filtered by a particular database:

    Post a Comment

    Featured Post

    The new Dell XPS 13’s overall design is 30% thinner and lighter than its predecessor

    The new Dell XPS 13 has twice the performance of the XPS 13 launched in 2015, as well as improved battery life that should enable the model...