Sign up ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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.

share|improve this question

1 Answer 1

up vote 6 down vote accepted

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

share|improve this answer
thanks for the answer ! –  bragboy Aug 27 '12 at 11:52
You're welcome :) –  Dawid Meyer Aug 27 '12 at 12:31

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.