Is there any query/way to show the last queries executed on ALL servers?
相关问题
- sqlyog export query result as csv
- NOT DISTINCT query in mySQL
- MySQL: conduct a basic search
- I want to trace logs using a Macro multi parameter
- Why sometimes there is one of more gap(s) in the v
You can look at the following in linux
vi .mysql_history
It may help1) If general mysql logging is enabled then we can check the queries in the log file or table based what we have mentioned in the config. Check what is enabled with the following command
If we need query history in table then
Take a look at the table mysql.general_log
If you prefer to output to a file:
2) We can also check the queries in the .mysql_history file cat ~/.mysql_history
You can enable a general query log for that sort of diagnostic. Generally you don't log all SELECT queries on a production server though, it's a performance killer.
Edit your MySQL config, e.g. /etc/mysql/my.cnf - look for, or add, a line like this
Restart mysql to pick up that change, now you can
Hey presto, you can watch the queries as they come in.