MySQL 8.0 – locking details

Recently, I saw many interest in understanding and getting information about database locking.

MySQL InnoDB’s locking can be complex and having an overview not always simple.

For more information about how InnoDB locking is working, I can only recommend this excellent series of articles by Kuba:

I’ve extended my MySQL Shell plugins to provide an overview of the locks.

Disclaimer: the output can be inconsistent with short locking waits

Let’s have a look at the output of the plugin:

click to enlarge

As you can see, the plugin returns the thread and connection ID. It also returns if a thread is blocking or blocked by another thread. The latest or current statement is also available and finally a summary of the locking information including which indexes and keys might be locked.

If you want to learn more about InnoDB locks of if you have some locking issue to solve, I encourage you to test this MySQL Shell plugin.

As usual, enjoy MySQL, InnoDB and MySQL Shell !

Subscribe to Blog via Email

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

As MySQL Community Manager, I am an employee of Oracle and the views expressed on this blog are my own and do not necessarily reflect the views of Oracle.

You can find articles I wrote on Oracle’s blog.