0

MySQL in RHEL 5.5 logs it errors in

/var/log/mysqld.log

Which grows to mammoth size frequently.

I need to disable it, but I failed to find any reference to do it. Finally I added below in my.cnf to redirect the logs to /dev/null

log = /dev/null

But I think it is not efficient as mysql will still switch context to write the log. Any idea how to disable mysql error log?

2
  • "Which grows to mammoth size frequently" and why it grows so fast? normally it should contain only a few lines
    – ALex_hha
    Sep 6, 2013 at 7:47
  • @ALex_hha Good Point, but since the error could be caused by the multiple users of the box, I can not fix the errors to solve them. Sep 6, 2013 at 13:08

1 Answer 1

3

Options in order of personal preference:

1: Fix the Error Condition.

2: Rotate and Compress the log(warning: this assumes non-binary logs), since you're using redhat, theres a handy script called mysql-log-rotate, Source: http://dev.mysql.com/doc/refman/5.0/en/log-file-maintenance.html

3: Disable Required Logging Mechanisms: As I'm unsure if you're talking about the general log, error log, slow query log or binary log, i can only point you to this page which has the required instructions for most mechanisms.

http://dev.mysql.com/doc/refman/5.1/en/server-logs.html

2
  • I am talking about error log. Since the error could be caused by the multiple users of the box, I can not fix the errors to solve them. Sep 6, 2013 at 13:07
  • What exactly contain error.log?
    – ALex_hha
    Sep 6, 2013 at 13:58

You must log in to answer this question.

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