try
cat ~/.mysql_history
this will show you all mysql commands ran on the system
For MySQL > 5.1.11 or MariaDB
SET GLOBAL log_output = 'TABLE';
SET GLOBAL general_log = 'ON';
mysql.general_log
If you want to output to a log file:
SET GLOBAL log_output = "FILE";
SET GLOBAL general_log_file = "/path/to/your/logfile.log"
SET GLOBAL general_log = 'ON';
As mentioned by jeffmjack in comments, these settings will be forgetting before next session unless you edit the configuration files (e.g. edit /etc/mysql/my.cnf
, then restart to apply changes).
Now, if you'd like you can tail -f /var/log/mysql/mysql.log
More info here: Server System Variables
You 'll find it there
~/.mysql_history
You 'll make it readable (without the escapes) like this:
sed "s/\\\040/ /g" < .mysql_history
(Linux)
Open your Terminal ctrl+alt+t
run the command
cat ~/.mysql_history
you will get all the previous mysql query history enjoy :)
Look at ~/.myslgui/query-browser/history.xml
here you can find the last queries made with mysql_query_browser
(some days old)
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