Is there a way to view past mysql queries with phpmyadmin?

I'm trying to track down a bug that's deleting rows in a mysql table.

For the life of me I can't track it down in my PHP code, so I'd like to work backwards by finding the actual mysql query that's removing the rows.

I logged in to phpmyadmin, but can't find a way to view the history of past sql operations.

Is there a way to view them in phpmyadmin?


Ok, so I actually stumbled across the answer.

phpMyAdmin does offer a brief history. If you click on the 'sql' icon just underneath the 'phpMyAdmin' logo, it'll open a new window. In the new window, just click on the 'history' tab.

That will give you the last twenty or so SQL operations.

enter image description here


There is a Console tab at the bottom of the SQL (query) screen. By default it is not expanded, but once clicked on it should expose tabs for Options, History and Clear. Click on history.

The Query history length is set from within Page Related Settings which found by clicking on the gear wheel at the top right of screen.

This is correct for PHP version 4.5.1-1


You just need to click on console at the bottom of the screen in phpMyAdmin and you will get the Executed history:

enter image description here


To view the past queries simply run this query in phpMyAdmin.

SELECT * FROM `general_log`

if it is not enabled, run the following two queries before running it.

SET GLOBAL log_output = 'TABLE';
SET GLOBAL general_log = 'ON';