Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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?

share|improve this question
    
"Which grows to mammoth size frequently" and why it grows so fast? normally it should contain only a few lines –  ALex_hha Sep 6 '13 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. –  user1263746 Sep 6 '13 at 13:08
add comment

1 Answer

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

share|improve this answer
    
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. –  user1263746 Sep 6 '13 at 13:07
    
What exactly contain error.log? –  ALex_hha Sep 6 '13 at 13:58
add comment

Your Answer

 
discard

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.