Page 1 of 1
How to show the last queries executed on MySQL?
Posted: 12 Nov 2018, 22:16
Edit your MySQL config, e.g. /etc/mysql/my.cnf - look for, or add, a line like this:
Code: Select all
log = /var/log/mysql/mysql.log
Restart mysql to pick up that change, now you can:
Hey presto, you can watch the queries as they come in.
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.