2

I connect to mysql client using the command

mysql -uroot -p

And I execute queries there. If I press the up arrow, i could see the history of almost all the queries there. Where will this query log be stored.

I found a log file under /var/log/mysql/mysql.log and I indeed see some logging happening there. But it has queries from other users as well. However, I only need queries executed by the specific user (root in this case). How to get it? Please help me.

Note: I need to debug some logs, so a solution to filter these logs with the existing setup would be great.

1 Answer 1

7

History for root is stored in /root/.mysql_history.

1
  • For non-root users: /home/nonrootusername/.mysql_history . If you are using GUI and you don't see hidden files, firt try pressing Ctrl + H while in the folder, if that doesn't help, search the Internet :)
    – jave.web
    Apr 11, 2017 at 5:49

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .