I need to get all queries that are made in last hour on开发者_如何学编程 my wordpress database.
You can enabled general log on mysql
details :
- http://dev.mysql.com/doc/refman/5.1/en/query-log.html
- http://dev.mysql.com/doc/refman/5.1/en/server-system-variables.html#sysvar_general_log
After that, you can parse/digest the log or simply do a grep
(linux).
If you not familiar with grep
, you can look for log analyzer for mysql
(I sure there is, but doing a grep
is much easier)
You can check the update queries (only queries which did a modification to the data) with Binary log or update log (You will need to enable them)
Slow queries are again logged to the slow query logs.
I am not aware if mysql logs read only queries.
Hope this is of some help.
精彩评论