Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top
# ls
error.log       mysql-slow.log.1.gz  mysql-slow.log.3.gz  mysql-slow.log.5.gz
mysql-slow.log  mysql-slow.log.2.gz  mysql-slow.log.4.gz  mysql-slow.log.6.gz

This is what I see. How do I view them? Why are there so many files anywyay?

What if I want to read them all as one file?

# ls -lh
total 36K
-rw-rw---- 1 mysql adm 6.5K 2012-02-12 21:59 error.log
-rw-r----- 1 mysql adm  174 2012-02-19 06:25 mysql-slow.log
-rw-r----- 1 mysql adm  154 2012-02-18 06:25 mysql-slow.log.1.gz
-rw-r----- 1 mysql adm  154 2012-02-17 06:25 mysql-slow.log.2.gz
-rw-r----- 1 mysql adm  154 2012-02-16 06:25 mysql-slow.log.3.gz
-rw-r----- 1 mysql adm  154 2012-02-15 06:25 mysql-slow.log.4.gz
-rw-r----- 1 mysql adm  154 2012-02-14 06:25 mysql-slow.log.5.gz
-rw-r----- 1 mysql adm  154 2012-02-13 06:25 mysql-slow.log.6.gz
share|improve this question
up vote 1 down vote accepted

zcat mysql-slow* | less

There are a few of them because they have been auto rotated (probably by logrotate).

If you don't have zcat installed you could run gunzip.

gunzip mysql-slow*.gz

Show us a ls -l to get a sense of when these files were rotated.

share|improve this answer
I edited with ls -l – Alex Feb 19 '12 at 8:01
After doing that, I got mysql-slow.log.1 , mysql-slow.log.2, ... I CAT each one, but they're all empty. (Also, Can I join them all instead of reading each file individually?) – Alex Feb 19 '12 at 8:02
An empty file is an empty log. That's generally a good thing for the MySQL slow query log. You can change the threshold in you config to try to get MySQL to report on faster running queries. – Joel K Feb 19 '12 at 16:32

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.