Real time query monitoring on MySQL using the SYS schemaearlier post I wrote about real time query monitoring on MySQL with a third party tool and without one. The script is useful as it works with MySQL 5.5 and later.
However, if you're using a later version of MySQL, you should look at the SYS schema. It is a collection of views, functions and procedures to help MySQL administrators get insight in to MySQL Database usage. It's available to install on Github and works with versions 5.6 and higher. For MySQL 5.6 you should manually install though scripts or using MySQL Workbench 6.1 or later. Since MySQL 5.7.6 the sys schema is already included.
To start using the SYS schema to check what SQL statements are being executed on a MySQL instance, open a MySQL prompt and run the following query on the 'session' view:
Don't forget to check the documentation for a complete overview, as well as the examples on project's github page.