# Cannot disable general query log

**URL:** <https://forums.percona.com/t/cannot-disable-general-query-log/879>\
**Category:** Other MySQL® Questions\
**Created:** [August 11, 2008, 7:38pm UTC](https://forums.percona.com/t/cannot-disable-general-query-log/879 "2008-08-11T19:38:03Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![carpii](https://avatars.discourse-cdn.com/v4/letter/c/b5ac83/32.png) [@carpii](https://forums.percona.com/u/carpii)\
**Post date:** [August 11, 2008, 7:38pm UTC](https://forums.percona.com/t/cannot-disable-general-query-log/879/1 "2008-08-11T19:38:03Z")

</div>

Ive had a problem with mysql for some time now.

When it starts, it writes the general query log to a file called ‘0’ in my mysql data directory. My server is VERY active, so this log file grows massive in a very short time.

Some time ago, I simply deleted the log file while mysql was running. It didnt recreate it so I thought the problem was solved.

That was a bit naive anyway, because linux continued to think the file was in use, and tonight started complaining about out of disk space errors. I restarted mysql and the disk space dropped back down the accurate value of 12%.

My real problem is that I cant seem to disable mysql writing to this 0 query log file.

Im running version  
Ver 5.0.22-log for redhat-linux-gnu on i686 (Source distribution)

Does the “-log” indicate that the log is hardcoded? surely not

The MySQL manual claims general query log is off by default, and can be turned on by a command line parameter.

“To enable the general query log as of MySQL 5.1.6, start mysqld with the --log[=file\_name] or -l [file\_name] option, and optionally use --log-output to specify the log destination”

I dont pass either of these, and the equivalent values arent in my.cnf

Does anyone have any ideas please? Im stumped.

---

<div class="post-metadata">

**Author:** ![csmiesing](https://avatars.discourse-cdn.com/v4/letter/c/3e96dc/32.png) [@csmiesing](https://forums.percona.com/u/csmiesing)\
**Post date:** [August 12, 2008, 1:05am UTC](https://forums.percona.com/t/cannot-disable-general-query-log/879/2 "2008-08-12T01:05:08Z")

</div>

Could you include your my.cnf in your text?

---

<div class="post-metadata">

**Author:** ![carpii](https://avatars.discourse-cdn.com/v4/letter/c/b5ac83/32.png) [@carpii](https://forums.percona.com/u/carpii)\
**Post date:** [August 12, 2008, 1:17am UTC](https://forums.percona.com/t/cannot-disable-general-query-log/879/3 "2008-08-12T01:17:25Z")

</div>

Hi, here we go…

Mysql version = 5.0.22-log

* * *

# Example MySQL config file for very large systems.## This is for a large system with memory of 1G-2G where the system runs mainly# MySQL.## You can copy this file to# /etc/my.cnf to set global options,# mysql-data-dir/my.cnf to set server-specific options (in this# installation this directory is /var/lib/mysql) or# ~/.my.cnf to set user-specific options.## In this file, you can use all long options that a program supports.# If you want to know which options a program supports, run the program# with the “–help” option.# The following options will be passed to all MySQL clients[client][mysqld]innodb# 05/05/2008.PAC - Configure query cachequery-cache-type = 1query-cache-size = 20Mkey\_buffer = 30M# 25/02/2006.PAC - no logging#log-bin=mysql-binskip-log# \>\># 2008/05/28.PAC - Moved tmp dir onto sdb1 - /backup/mysqltmptmpdir = /tmp/# 25/02/2006.PAC moved data dir onto 400G disk# 2008/05/28.PAC - data is back on sda1 due to server movedatadir = /data/mysql/max\_connections=400max\_connect\_errors = 999999999skip-name-resolveskip-lockinginnodb\_data\_home\_dir = /data/mysqlinnodb\_data\_file\_path = ibdata1:5000M;ibdata2:10M:autoextend# 05/05/2008.PAC - Upped from 384M to 1000Minnodb\_buffer\_pool\_size = 1000Minnodb\_additional\_mem\_pool\_size = 20M[mysqldump]quickmax\_allowed\_packet = 16M[mysql]no-auto-rehash[isamchk]key\_buffer = 256Msort\_buffer\_size = 256Mread\_buffer = 2Mwrite\_buffer = 2M[myisamchk]key\_buffer = 256Msort\_buffer\_size = 256Mread\_buffer = 2Mwrite\_buffer = 2M[mysqlhotcopy]interactive-timeout

---

<div class="post-metadata">

**Author:** ![csmiesing](https://avatars.discourse-cdn.com/v4/letter/c/3e96dc/32.png) [@csmiesing](https://forums.percona.com/u/csmiesing)\
**Post date:** [August 12, 2008, 1:33am UTC](https://forums.percona.com/t/cannot-disable-general-query-log/879/4 "2008-08-12T01:33:06Z")

</div>

are there no other my.cnf files used?  
I don’t see any server id’s for example and this should be a slave, isn’t it?

use the command

show variables in mysql and look for the log setting  
it should be off

---

<div class="post-metadata">

**Author:** ![carpii](https://avatars.discourse-cdn.com/v4/letter/c/b5ac83/32.png) [@carpii](https://forums.percona.com/u/carpii)\
**Post date:** [August 12, 2008, 1:45am UTC](https://forums.percona.com/t/cannot-disable-general-query-log/879/5 "2008-08-12T01:45:09Z")

</div>

| [B]csmiesing wrote[/B] |
| 

are there no other my.cnf files used?

 |

No, thats what it appears like. But I checked mt init scripts, and even the cmdline in ps output, and /etc/my.cnf is the only one being used.

| [B]csmiesing wrote[/B] |
| 

I don’t see any server id’s for example and this should be a slave, isn’t it?

 |

Hm well, I dont use replication, its a standalone server. Is it still relevant?

| [B]csmiesing wrote[/B] |
| 

use the command

show variables in mysql and look for the log setting  
it should be off

 |

Log is “ON”. Its like this as soon as mysqld starts, yet theres nothing I can find which would explain this.

mysql\> show variables like ‘%log%’;  
±--------------------------------±-----------+  
| Variable\_name | Value |  
±--------------------------------±-----------+  
| back\_log | 50 |  
| bdb\_log\_buffer\_size | 32768 |  
| bdb\_logdir | |  
| binlog\_cache\_size | 32768 |  
| expire\_logs\_days | 0 |  
| innodb\_flush\_log\_at\_trx\_commit | 1 |  
| innodb\_locks\_unsafe\_for\_binlog | OFF |  
| innodb\_log\_arch\_dir | |  
| innodb\_log\_archive | OFF |  
| innodb\_log\_buffer\_size | 1048576 |  
| innodb\_log\_file\_size | 5242880 |  
| innodb\_log\_files\_in\_group | 2 |  
| innodb\_log\_group\_home\_dir | ./ |  
| innodb\_mirrored\_log\_groups | 1 |  
| log | ON |   
| log\_bin | OFF |  
| log\_bin\_trust\_function\_creators | OFF |  
| log\_error | |  
| log\_slave\_updates | OFF |  
| log\_slow\_queries | OFF |  
| log\_warnings | 1 |  
| max\_binlog\_cache\_size | 4294967295 |  
| max\_binlog\_size | 1073741824 |  
| max\_relay\_log\_size | 0 |  
| relay\_log\_purge | ON |  
| relay\_log\_space\_limit | 0 |  
| sync\_binlog | 0 |  
±--------------------------------±-----------+

---

<div class="post-metadata">

**Author:** ![csmiesing](https://avatars.discourse-cdn.com/v4/letter/c/3e96dc/32.png) [@csmiesing](https://forums.percona.com/u/csmiesing)\
**Post date:** [August 12, 2008, 2:11am UTC](https://forums.percona.com/t/cannot-disable-general-query-log/879/6 "2008-08-12T02:11:09Z")

</div>

in your my.cnf settingsfile is a line

skip-log

that command doesn’t exist and when i use it in my.cnf file it does turn the logging on  
so delete this line and restart your mysql server

---

<div class="post-metadata">

**Author:** ![carpii](https://avatars.discourse-cdn.com/v4/letter/c/b5ac83/32.png) [@carpii](https://forums.percona.com/u/carpii)\
**Post date:** [August 13, 2008, 5:28pm UTC](https://forums.percona.com/t/cannot-disable-general-query-log/879/7 "2008-08-13T17:28:28Z")

</div>

Wow, thankyou so much!

I have no idea how to explain that. I added the config line myself a long time ago, and even commented it (so I didnt even consider the possibility of that being at fault).

I guess a fresh pair of eyes always helps, thanks again )
