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.

My question is how to stop logs on mysql

log_error = /var/log/mysql/error.log i have commented already.

with slow queries too. But i have one more log file in /var/lib/mysql/hostname.log with hostname I mean that for example I am on server called hulk so the log will be hulk.log and so on. In that log are all queries. So the log is growing really fast and also is really big. So my question is how to disable this log ?

Regards ;)

share|improve this question
    
Why would you want to stop logging? What happens if you need to track down some error? –  mdpc Jan 26 '13 at 1:45

2 Answers 2

up vote 4 down vote accepted

If you would like to dynamically stop logging, login as root@localhost and run this:

SET GLOBAL general_log = 'OFF';

That's it. No restart of mysql needed.

If you are not root@localhost, you will need to be logged in as a user with SUPER privilege.

share|improve this answer
    
thx man it is works ;) –  nonus25 Jan 26 '13 at 21:55
    
Please accept my answer... –  RolandoMySQLDBA Jan 26 '13 at 22:52

In MySQL 5.1.12+ add/change this in your my.cnf

general-log = 0

In MySQL 5.1.11- remove this in your my.cnf

log

or

log = 

Source:

http://dev.mysql.com/doc/refman/5.1/en/server-system-variables.html#sysvar_general_log

http://dev.mysql.com/doc/refman/5.1/en/server-options.html#option_mysqld_log

share|improve this answer
    
general-log = 0 works fine, but on master I cant do restart so I disable logs like RolandoMySQLDBA said. But on slaves I tries your way and is working also thx –  nonus25 Jan 26 '13 at 21:59

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.