How to find the latest queries run in MySQL

Run the following queries –

  1. SET GLOBAL log_output = 'TABLE';
  2. SET GLOBAL general_log = 'ON';

After the latest 100 queries executed after this is done can be found by running the query –

SELECT * FROM mysql.general_log where argument like ‘%[queryPiece]%’ order by event_time desc LIMIT 0,100

Leave a Reply

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

*

* Copy This Password *

* Type Or Paste Password Here *

44,588 Spam Comments Blocked so far by Spam Free Wordpress

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>