MySQL Shell Plugins: check


This blog was initially referring to the audit plugin, but I renamed it as check plugin to be more compatible with all the current and future methods included in it.

As you may know, it’s now possible to create your own plugins for MySQL Shell. See the following posts:

I’ve created several plugins that you can find on github. My colleague Bernt already contributed too.

You are more than welcome to comment, fill bugs, feature requests and pull requests of course !

I want to start a series of article covering those plugins. Their goal and how to use them.

Check Plugin

I will start today with the check one and particularly the methods/functions related to the binary logs.

Let’s first see the help of that plugin:


Let’s see an example of the execution of that method:

So on my server we can see that currently we have 9 binlog files available.


This method prints the IO statistics of binary logs files available on the server:

Let’s run show binlog events in 'binlog.000052'; and see the new output:

showTrxSize() and showTrxSizeSort()

And finally, let’s verify the size of transactions in the binary logs. We have two methods, one showing the transactions from the end to the start of the last binary log or the one provided as argument. The other one sort them by size descending and limit it to 10 by default:

Let’s see the last one in action:

This is a good way to see if your don’t have transaction size bigger than group_replication_transaction_size_limit when you want to migrate to MySQL InnoDB Cluster.

In the next post, I will cover the remaining methods of the check plugin.

9 thoughts on “MySQL Shell Plugins: check

  1. Tried to install this but getting
    WARNING: Found errors loading plugins, for more details look at the log at: /home/mysql/.mysqlsh/mysqlsh.log

    And in there
    2019-11-20 16:51:39: Error: Error loading Python file ‘/home/mysql/.mysqlsh/plugins/ext/audit/’:
    Execution failed:
    Traceback (most recent call last):
    File “”, line 1, in
    ImportError: No module named mysqlsh_plugins_common

    So it seems like a bootstrapping problem in that the plugins need mysqlsh_plugins_common, but how/where is mysqlsh_plugins_common supposed to be found?

      1. mysql-shell-commercial-8.0.17-1.1.el7.x86_64

        I wasn’t exactly clear on how to extract things. This is how I have it currently.

    1. I was able to bootstrap it by creating this file
      cat /home/mysql/.mysqlsh/

      and then making sure and extracted files are stored like this

        1. Yes, I’m logged in as mysql. If you want to compare your sys.path to mine, here it is.
          MySQL localhost+ ssl Py > sys.path
          Perhaps mysqlsh_plugins_common is in one of the /usr/share/mysqlsh/oci_sdk locations for you.

          1. Thx for the info.. no it’s not there and my sys.path is the following:
            Py  sys.path

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.

I deeply value the diversity of MySQL developers, users, community and my blog readers. I cannot agree the suffering, oppression, and systemic racism the Black community faces every day. Black lives matter.