1

I have Investigated enabling MySQL query logging. At some point, soon, it would be nice to enable this on my companies production server so that if there is ever a question about queries run against the database, we can see them.

I have found: Add the following line to /etc/my.cnf: log=/var/log/mysql_query.log and restart the MySQL server. I could also profile slow queries: log-slow-queries = /var/log/mysql_slow_queries.log long_query_time = 1.

I have not yet found any documentation detailing log file size capping to ensure that the file does not continue to grow past a certain point. Is anyone aware of such a thing?

1 Answer 1

2

You can use logrotate on linux to help with this. There are many howtos that show you how to do this. Essentially, make sure logrotate is in your crontab, I use the daily one on busy machines.

Then just create /etc/logrotate.d/mysql accordingly and you're off to the races!

Here's a great howto:

http://www.question-defense.com/2009/12/20/configure-logrotate-to-rotate-and-flush-mysql-logs-without-a-password

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.