Is there any query/way to show the last queries executed on ALL servers?
In CodeIgniter there is a helper function $this->db->last_query(); . This will return the string of the last query.
Show activity on this post. From the bottom panel, change "Action Output" to "History" and then choose the appropriate date. Alternatively, the SQL statement history is stored in text files under two locations: sql_history/yyyy-mm-dd e.g., sql_history/2015-04-01: Full Workbench SQL history for all MySQL connections.
For those blessed with MySQL >= 5.1.12, you can control this option globally at runtime:
SET GLOBAL log_output = 'TABLE';
SET GLOBAL general_log = 'ON';
mysql.general_log
If you prefer to output to a file instead of a table:
SET GLOBAL log_output = "FILE";
the default.SET GLOBAL general_log_file = "/path/to/your/logfile.log";
SET GLOBAL general_log = 'ON';
I prefer this method to editing .cnf files because:
my.cnf
file and potentially permanently turning on logging/var/log /var/data/log
/opt /home/mysql_savior/var
For more information, see MySQL 5.1 Reference Manual - Server System Variables - general_log
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With