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.

I recently discovered that my general_log was turned on and it had generated a 400gb log file. OUCH.. Then I tried to turn it off.

while running I entered "SET GLOBAL general_log = OFF" and sure enough, it turned it off. Until the next restart of mysql and it was back on again!

I looked at my.cnf and there was nothing there about general_log that would have turned it on so just to be safe I added general_log=0 under the [mysqld] heading. I restarted mysql again and sure enough, general_log is on again!!!

Then I edited /etc/sysconfig/mysqld and added the --general_log=0 to the command line and restarted mysql...


>  /etc/init.d/mysqld restart
/etc/sysconfig/mysqld: line 10: --general_log=0: command not found
Stopping mysqld:                                           [  OK  ]
Starting mysqld:                                           [  OK  ]

Ok, so it complained about it but, SUCCESS the general log is finally off!! But this just isn't right.. We don't like error messages, even though it is seeing that commandline option and using it just fine.

So, three questions..

  1. why would the my.cnf fix not work?
  2. why would turning it off from within mysql not keep it off
  3. why would it require the command line option that it complains about but yet accepts.

I am running Server version: 5.5.30-cll on CentOS 5.9

Would appreciate any help you can give.. Googling just isn't finding answers on this one.

share|improve this question
    
See this bugs.mysql.com/bug.php?id=51631 –  StackKrish Apr 19 '13 at 9:31
add comment

2 Answers

There is a bug report on this and it is claimed that a patch went in. However, there are times when patches are applied to future minor releases. Bug report claims it was fixed in MySQL 5.5.9 yet you are seeing this issue in MySQL 5.5.30.

I once answered a question in the DBA StackExchange where a replication bug patch had skipped a release. I also answered another question where the SLEEP function is missed in starting up with an init-script. I suspect a missed patch there as well.

SOLUTION

Instead of doing this

[mysqld]
general-log=0

try commenting it out

[mysqld]
#general-log=0

and restarting mysql

share|improve this answer
add comment

Regarding to this issue:

> I recently discovered that my general_log was turned on and it had generated a 400gb log file
> So, three questions..
>
> why would the my.cnf fix not work?
> why would turning it off from within mysql not keep it off
> why would it require the command line option that it complains about but yet accepts.

I 'discovered' this problem after upgrading MySQL 5.1 to the 5.6 release and 'suffered' with this problem for some weeks, waiting for a reasonable reason for this 'strange' behaviour (even when doing like mentined below !) from someone in the MySQL support team and other forums, unfortunately without answers.

Sincerely, doing "SET GLOBAL general_log = 'OFF';" and "SET GLOBAL slow_query_log = 'OFF';" doesn´t solved this, PERMANENTLY !

Then I tried by myself to put a final dot in this issue, modifying some parameters in MY.INI file that was located in the same folder where I put the MySQL databases, like this:

# General and Slow logging.
log-output=FILE
general-log=0                            <--- HERE !
general_log_file="NATCOMP7.log"
slow-query-log=0                         <--- And HERE !
slow_query_log_file="NATCOMP7-slow.log"
long_query_time=10

Well, this solved this 'problem' in one Windows environment.

HTH

share|improve this answer
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.